cmd + k interface for dash applications
Project description
dash kbar
cmd + k interface for dash applications
Installation
pip install dash_kbar
Usage
dash_kbar.DashKbar(
id="input",
actions=[
{"name": "Action 1", "id": "action1"},
{"name": "Action 2", "id": "action2"},
],
style={
"itemTextColor": "grey",
},
)
Look into usage.py
for a functioning example usage.
API
The following properties are accepted by DashKbar
.
Property | Description | Type | Default |
---|---|---|---|
id |
The ID used to identify this component in Dash callbacks | str |
None |
actions |
List of actions to display in the kbar | list[dict[str, str]] |
[] |
style |
Style of the kbar | dict[str, str] |
{} |
selected |
ID of the selected item. You can use this prop in callbacks. | str |
None |
debug |
Show the id of the selected item in the browser console | bool |
False |
Actions
Actions should be a list of dictionaries with the following keys.
Key | Description | Type | Required |
---|---|---|---|
name |
Name of the action | str |
Yes |
id |
ID of the action | str |
Yes |
subtitle |
Subtitle of the action | str |
No |
section |
Section of the action | str |
No |
icon |
Icon of the action | str |
No |
parent |
If this is a child item, give the id of the parent | str |
No |
noAction |
Dont change the selected prop when you select this. Usually used for parent actions. |
bool |
No |
shortcut |
Shortcut of the action | list[str] |
No |
Styling
Style should be a dictionary with one or more of the following keys.
Key | Description | Default |
---|---|---|
maxWidth |
Maximum width of the kbar | 600px |
width |
Width of the kbar | 100% |
background |
Background color of the kbar | white |
searchBackground |
Background color of the search input box | transparent |
searchTextColor |
Text color of the search input box | grey |
fontFamily |
Font family of the kbar | sans-serif |
itemTextColor |
Text color of the items | grey |
itemSubtitleTextColor |
Text color of the item subtitles | grey |
sectionTitleTextColor |
Text color of the section titles | grey |
selectedBackground |
Background color of the selected item | rgba(34, 139, 230, 0.1) |
selectedTextColor |
Text color of the selected item | grey |
selectedLeftBorderColor |
Left border color of the selected item | rgba(34, 139, 230, 1) |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dash_kbar-0.2.0.tar.gz
(100.7 kB
view hashes)
Built Distribution
dash_kbar-0.2.0-py3-none-any.whl
(100.9 kB
view hashes)
Close
Hashes for dash_kbar-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9ac0e947c53a8af196ffda87ba8c26021d62b5d9e2f92fcbad7903dca6b718e |
|
MD5 | 999db58796ecdd3da9744590e27ee94c |
|
BLAKE2b-256 | 3f9f3d675b48d7e7de0d20fd4904f08acc35ffeeef6cf5bbf9f04448a714f049 |