Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

idling-mind/dash_kbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmd + k interface for dash applications

dash_kbar_animation

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 intousage.py for a functioning example usage.

API

The following properties are accepted byDashKbar.

PropertyDescriptionTypeDefault
idThe ID used to identify this component in Dash callbacksstrNone
actionsList of actions to display in the kbarlist[dict[str, str]][]
styleStyle of the kbardict[str, str]{}
selectedID of the selected item. You can use this prop in callbacks.strNone
debugShow the id of the selected item in the browser consoleboolFalse

Actions

Actions should be a list of dictionaries with the following keys.

KeyDescriptionTypeRequired
nameName of the actionstrYes
idID of the actionstrYes
subtitleSubtitle of the actionstrNo
keywordsKeywords of the actionlist[str]No
sectionSection of the actionstrNo
iconIcon of the actionstrNo
parentIf this is a child item, give the id of the parentstrNo
priorityPriority of the action. Higher priority actions will be shown first. Should be one of 1 (high), 0 (normal, default) or -1 (low)intNo
actionableBoolean denoting whether selecting this action will change theselected property. Set this toFalse for parent actions where selecting the parent should show the child actions.boolNo
shortcutShortcut of the actionlist[str]No

Styling

Style should be a dictionary with one or more of the following keys.

KeyDescriptionDefault
maxWidthMaximum width of the kbar600px
widthWidth of the kbar100%
backgroundBackground color of the kbarwhite
searchBackgroundBackground color of the search input boxtransparent
searchTextColorText color of the search input boxgrey
fontFamilyFont family of the kbarsans-serif
itemTextColorText color of the itemsgrey
itemSubtitleTextColorText color of the item subtitlesgrey
sectionTitleTextColorText color of the section titlesgrey
selectedBackgroundBackground color of the selected itemrgba(34, 139, 230, 0.1)
selectedTextColorText color of the selected itemgrey
selectedLeftBorderColorLeft border color of the selected itemrgba(34, 139, 230, 1)
boxShadowBox shadow of the kbar0 0 20px rgba(0, 0, 0, 0.1)
borderRadiusBorder radius of the kbar8px
searchBoxFontSizeFont size of the search input box16px
resultFontSizeFont size of the items14px
subtitleFontSizeFont size of the item subtitles12px
sectionTitleFontSizeFont size of the section titles10px
shortcutBackgroundBackground color of the shortcutrgba(0 0 0 / .1)

[8]ページ先頭

©2009-2025 Movatter.jp