components/Surface
import { … } from 'zidane-ui'ui/src/components/Surface.tsx
Components#
CodePanelComponent#
Renders monospace output or input in a pre, set into its surface.
function CodePanel(props: CodePanelProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | CodePanelProps | Component props. |
Returns
ElementProps
| Name | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The text to show. | |
| className? | string | Extra classes on the | |
| maxHeight? | string | number | Maximum height of the panel, as a CSS length or a number of pixels. The panel scrolls past it. | |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. | |
| wrap? | boolean | true | Wrap long lines. When off, the panel scrolls horizontally instead. |
EmptyStateComponent#
Renders the one empty or placeholder block: an optional icon, a title, a hint and an action, centred, usually in a tray.
function EmptyState(props: EmptyStateProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | EmptyStateProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| action? | ReactNode | Control under the hint, such as a button. |
| className? | string | Extra classes on the wrapping element. |
| compact? | boolean | Less vertical room, for a panel tab. |
| framed? | boolean | Set in a tray. Off inside a surface that is already tray-toned (the side panel): no tray on a tray. |
| hint? | ReactNode | Secondary text under the title. |
| icon? | string | Icon class shown above the title. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| title | ReactNode | Main message. |
| titleAs? | 'div' | 'h1' | 'h2' | 'h3' | The title's element: a heading where the empty state is the page (a 404). |
MetaComponent#
The technical voice: mono, tabular, small, muted.
function Meta(props: MetaProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | MetaProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The value to show. |
| className? | string | Extra classes on the text. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| title? | string | Native tooltip. |
RaisedComponent#
Renders a card or control lifted off its tray, with a border and the raised shadow. Accepts
the attributes of a div.
function Raised(props: RaisedProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | RaisedProps | A |
Returns
ElementProps
| Name | Type | Default | Description |
|---|---|---|---|
| live? | boolean | Lift the card one step with the live shadow, for something that is active right now. | |
radius?from TrayProps | Radius | 'lg' | Corner radius: |
SectionLabelComponent#
Uppercase label for a section of a panel, menu or form.
function SectionLabel(props: SectionLabelProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | SectionLabelProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The label text. |
| className? | string | Extra classes on the label. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
TrayComponent#
Renders the bed of the surface ladder: sections, wells for grouped rows, code and quiet
cards. Accepts the attributes of a div.
function Tray(props: TrayProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | TrayProps | A |
Returns
ElementProps
| Name | Type | Default | Description |
|---|---|---|---|
| radius? | Radius | 'lg' | Corner radius: |
Interfaces#
CodePanelPropsInterface#
Props for CodePanel.
interface CodePanelPropsProperties
| Name | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The text to show. | |
| className? | string | Extra classes on the | |
| maxHeight? | string | number | Maximum height of the panel, as a CSS length or a number of pixels. The panel scrolls past it. | |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. | |
| wrap? | boolean | true | Wrap long lines. When off, the panel scrolls horizontally instead. |
EmptyStatePropsInterface#
Props for EmptyState.
interface EmptyStatePropsProperties
| Name | Type | Description |
|---|---|---|
| action? | ReactNode | Control under the hint, such as a button. |
| className? | string | Extra classes on the wrapping element. |
| compact? | boolean | Less vertical room, for a panel tab. |
| framed? | boolean | Set in a tray. Off inside a surface that is already tray-toned (the side panel): no tray on a tray. |
| hint? | ReactNode | Secondary text under the title. |
| icon? | string | Icon class shown above the title. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| title | ReactNode | Main message. |
| titleAs? | 'div' | 'h1' | 'h2' | 'h3' | The title's element: a heading where the empty state is the page (a 404). |
MetaPropsInterface#
Props for Meta.
interface MetaPropsProperties
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The value to show. |
| className? | string | Extra classes on the text. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| title? | string | Native tooltip. |
RaisedPropsInterface#
SectionLabelPropsInterface#
Props for SectionLabel.
interface SectionLabelPropsProperties
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The label text. |
| className? | string | Extra classes on the label. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
TrayPropsInterface#
Props for Tray: a radius and the attributes of a div.
interface TrayProps extends HTMLAttributes<HTMLDivElement>Properties
| Name | Type | Default | Description |
|---|---|---|---|
| radius? | Radius | 'lg' | Corner radius: |