mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
Each carries its typed props, a behaviour suite and live examples the docs render from source, so ui.hanzo.ai documents them the moment the barrel names them.
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import { YStack } from "@hanzo/gui"
|
||
import {
|
||
Button,
|
||
Empty,
|
||
EmptyContent,
|
||
EmptyDescription,
|
||
EmptyHeader,
|
||
EmptyMedia,
|
||
EmptyTitle,
|
||
} from "@hanzo/ui"
|
||
|
||
/** Default — a media slot above a title and description, with a button in the content slot. */
|
||
export function Default() {
|
||
return (
|
||
<Empty>
|
||
<EmptyHeader>
|
||
<EmptyMedia variant="icon">+</EmptyMedia>
|
||
<EmptyTitle>No data</EmptyTitle>
|
||
<EmptyDescription>No data found. Add one to get started.</EmptyDescription>
|
||
</EmptyHeader>
|
||
<EmptyContent>
|
||
<Button>Add data</Button>
|
||
</EmptyContent>
|
||
</Empty>
|
||
)
|
||
}
|
||
|
||
/** Plain media — `variant="default"` leaves the media unboxed, for a larger custom icon or logo. */
|
||
export function PlainMedia() {
|
||
return (
|
||
<Empty>
|
||
<EmptyHeader>
|
||
<EmptyMedia>🗂️</EmptyMedia>
|
||
<EmptyTitle>No projects</EmptyTitle>
|
||
<EmptyDescription>You have not created any projects yet.</EmptyDescription>
|
||
</EmptyHeader>
|
||
</Empty>
|
||
)
|
||
}
|
||
|
||
/** With actions — two buttons stacked in the content slot below the description. */
|
||
export function WithActions() {
|
||
return (
|
||
<Empty>
|
||
<EmptyHeader>
|
||
<EmptyMedia variant="icon">⚠</EmptyMedia>
|
||
<EmptyTitle>Something went wrong</EmptyTitle>
|
||
<EmptyDescription>We could not load your notifications.</EmptyDescription>
|
||
</EmptyHeader>
|
||
<EmptyContent>
|
||
<YStack gap="$2" width="100%">
|
||
<Button>Retry</Button>
|
||
<Button variant="outline">Go back</Button>
|
||
</YStack>
|
||
</EmptyContent>
|
||
</Empty>
|
||
)
|
||
}
|