components/IconPicker
import { … } from 'zidane-ui'ui/src/components/IconPicker.tsx
Components#
IconPickerComponent#
The emoji / image picker body — directory icons here, space icons in Settings › Workspace › Spaces. Hosts own the popover and the persistence.
function IconPicker(props: IconPickerProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | IconPickerProps | The |
Returns
ElementProps
| Name | Type | Default | Description |
|---|---|---|---|
| autoFocus? | boolean | true | Focus the emoji field as it opens. |
| hasIcon | boolean | An icon is set: the reset row shows. | |
| onPick | (icon: IconPick | null) => void |
| |
| resetLabel | string | Label of the reset row (shown when an icon is set), such as "Reset to folder". |
Constants#
ICON_PICKER_WIDTHConstant#
Width of the picker's popover — shared with other hosts of IconPicker (space icons).
const ICON_PICKER_WIDTH = 232Interfaces#
IconPickerPropsInterface#
Props of IconPicker.
interface IconPickerPropsProperties
| Name | Type | Default | Description |
|---|---|---|---|
| autoFocus? | boolean | true | Focus the emoji field as it opens. |
| hasIcon | boolean | An icon is set: the reset row shows. | |
| onPick | (icon: IconPick | null) => void |
| |
| resetLabel | string | Label of the reset row (shown when an icon is set), such as "Reset to folder". |
Types#
IconPickType#
What the picker picks: an emoji, or a small image as a data URL.
type IconPick = { kind: 'emoji'; value: string } | { kind: 'image'; value: string }