components/BrowserChrome
import { … } from 'zidane-ui'ui/src/components/BrowserChrome.tsx
Components#
AddressBarComponent#
Shows the page's URL, led by its site icon (a globe until the icon is known,
or when the site has none); while focused, a draft the page never overwrites.
Focus selects all, Enter loads, Escape reverts. Input normalize refuses
(null) shakes the field instead of loading something surprising. Enter
on an emptied field calls onSubmitEmpty when given (the start page).
function AddressBar(props: AddressBarProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | AddressBarProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root element. |
| icon | string | null | The site's icon URL; a globe without one. |
| normalize | (input: string) => string | null | The URL to load for what was typed, or |
| onSubmit | (url: string) => void | Loads the URL |
| onSubmitEmpty? | () => void | Enter on an empty field. Absent: the field shakes, like any input |
| placeholder? | string | Default: the |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| title | string | The page's title, as the field's tooltip; empty falls back to |
| url | string | The page's current URL, shown while the field is not focused. |
NavButtonComponent#
Renders a round toolbar button for a nav segment (back, forward, reload…).
active tints it and sets aria-pressed; disabled, it stays flat.
function NavButton(props: NavButtonProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | NavButtonProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| active? | boolean | A toggle that is on: accent-tinted and |
| className? | string | Extra classes on the root element. |
| disabled? | boolean | Greys it out and ignores clicks (nothing to go back to). Default: false. |
| icon | string | An icon class ( |
| label | string | Accessible name and tooltip. |
| onClick | () => void | Runs the action. |
| size? | 'sm' | 'md' | Button size, as |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
AddressBarPropsInterface#
Props for AddressBar.
interface AddressBarPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root element. |
| icon | string | null | The site's icon URL; a globe without one. |
| normalize | (input: string) => string | null | The URL to load for what was typed, or |
| onSubmit | (url: string) => void | Loads the URL |
| onSubmitEmpty? | () => void | Enter on an empty field. Absent: the field shakes, like any input |
| placeholder? | string | Default: the |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| title | string | The page's title, as the field's tooltip; empty falls back to |
| url | string | The page's current URL, shown while the field is not focused. |
NavButtonPropsInterface#
Props for NavButton.
interface NavButtonPropsProperties
| Name | Type | Description |
|---|---|---|
| active? | boolean | A toggle that is on: accent-tinted and |
| className? | string | Extra classes on the root element. |
| disabled? | boolean | Greys it out and ignores clicks (nothing to go back to). Default: false. |
| icon | string | An icon class ( |
| label | string | Accessible name and tooltip. |
| onClick | () => void | Runs the action. |
| size? | 'sm' | 'md' | Button size, as |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |