mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
The docs site renders every component the barrel names, the gallery harvests rules for all of them, and the pages come from the packages rather than a hand-kept copy. Co-authored-by: Hanzo Dev <[email protected]>
30 lines
959 B
TypeScript
30 lines
959 B
TypeScript
import { YStack } from "@hanzo/gui"
|
|
import { Editor } from "@hanzo/ui"
|
|
|
|
/** Default — a bold/italic/list toolbar above a blank contentEditable field. */
|
|
export function Default() {
|
|
return (
|
|
<YStack width="100%" minH={280} items="center" justify="center">
|
|
<Editor width="100%" maxW={480} />
|
|
</YStack>
|
|
)
|
|
}
|
|
|
|
/** With content — starts the region with existing HTML rather than empty. */
|
|
export function WithContent() {
|
|
return (
|
|
<YStack width="100%" minH={280} items="center" justify="center">
|
|
<Editor width="100%" maxW={480} value="<p><strong>Hello</strong> there — <em>start editing</em>.</p>" />
|
|
</YStack>
|
|
)
|
|
}
|
|
|
|
/** Custom placeholder — shown by the surrounding app's CSS when the field is empty. */
|
|
export function CustomPlaceholder() {
|
|
return (
|
|
<YStack width="100%" minH={280} items="center" justify="center">
|
|
<Editor width="100%" maxW={480} placeholder="Write your notes here..." />
|
|
</YStack>
|
|
)
|
|
}
|