Skeleton
Use to show a placeholder while content is loading.
import Skeleton from '@dinui/react/skeleton'
export default function SkeletonDemo() { return ( <div className="flex items-center space-x-4"> <Skeleton className="h-12 w-12 rounded-full" /> <div className="space-y-2"> <Skeleton className="h-4 w-[250px]" /> <Skeleton className="h-4 w-[200px]" /> </div> </div> )}Card
import Skeleton from '@dinui/react/skeleton'
export default function SkeletonCard() { return ( <div className="flex flex-col space-y-3"> <Skeleton className="h-[125px] w-[250px] rounded-xl" /> <div className="space-y-2"> <Skeleton className="h-4 w-[250px]" /> <Skeleton className="h-4 w-[200px]" /> </div> </div> )}Installation
-
Follow Installation Guide
To enable DinUI functionality in your project, you will need to properly set up Tailwind and install the necessary dependencies. -
All done
You now can start using this component in your project.
-
Follow Installation Guide
To enable DinUI functionality in your project, you will need to properly set up Tailwind and install the necessary dependencies. -
Run the following command in your project
Terminal window npx @dinui/cli@latest add skeletonTerminal window yarn dlx @dinui/cli@latest add skeletonTerminal window pnpm dlx @dinui/cli@latest add skeletonTerminal window bunx @dinui/cli@latest add skeleton -
Update the import paths to match your project setup
-
All done
You now can start using this component in your project.
-
Follow Installation Guide
To enable DinUI functionality in your project, you will need to properly set up Tailwind and install the necessary dependencies. -
Install dependencies
Terminal window npm install tailwind-variantsTerminal window yarn add tailwind-variantsTerminal window pnpm add tailwind-variantsTerminal window bun add tailwind-variants -
Copy and paste the following code into your project
import { forwardRef } from 'react'import { tv } from 'tailwind-variants'const skeleton = tv({slots: {root: 'animate-pulse rounded-md bg-bg--muted',},})const Skeleton = forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => {const { root } = skeleton()return <div {...props} ref={ref} className={root({ className: props.className })} />})Skeleton.displayName = 'Skeleton'export default Skeleton -
Update the import paths to match your project setup
-
All done
You now can start using this component in your project.