import React from 'react'; import { useImmer } from 'use-immer'; import type { IntentType, SizeType } from '../const'; import { daisy } from '../utils/daisy'; export const DaisyThemeDemo = () => { const [state, update] = useImmer<{ size?: SizeType; intent?: IntentType }>({ size: undefined, intent: undefined, }); const { size, intent } = state; const btnx = daisy('btn', { size, intent }); return (
  • { update({ ...state, size: undefined }); }} > Default
  • {sizes.map((v) => { return (
  • { update({ ...state, size: v }); }} > {v}
  • ); })}
  • { update({ ...state, intent: undefined }); }} > Default
  • {intents.map((v) => { return (
  • { update({ ...state, intent: v }); }} > {v}
  • ); })}
div]:px-4'}>
button
{intents.map((v) => ( ))}
{sizes.map((v) => ( ))}
badge
neutral
primary
secondary
accent
ghost
info
success
warning
error
lg
md
sm
xs
outline
div]:flex [&>div]:gap-2'}>
checkbox
div]:flex [&>div]:gap-2'}>
radio
link
link link-primary link-secondary link-accent link-neutral link-hover
tabs
Tab 1 Tab 2 Tab 3
tab-bordered Tab 2 Tab 3
tab-lifted Tab 2 Tab 3
tabs-boxed Tab 2 Tab 3
{/* size */}
tab-xs Tiny Tiny
tab-sm Small Small
Normal Normal Normal
tab-lg Large Large
progress
radial-progress
0%
10%
primary
35%
10rem/2px
10rem/2rem
); }; const intents: IntentType[] = ['primary', 'secondary', 'accent', 'info', 'success', 'warning', 'error']; const sizes: SizeType[] = ['xs', 'sm', 'md', 'lg'];