Skip to main content

skelion generate

Generate skeleton components from built-in templates.

Usage

npx skelion generate <template> [options]

Available Templates

TemplateDescription
cardCard layout (image block + text lines)
listList with avatars (configurable rows)
profileUser profile (avatar + name + bio + buttons)
tableData table (configurable rows and columns)

Options

OptionDefaultDescription
-n, --name <name>Derived from templateComponent name
-o, --output <dir>./components/skeletonsOutput directory
-a, --animation <type>From config or "pulse"Animation style

Examples

Generate a card skeleton

npx skelion generate card

Creates ./components/skeletons/CardSkeleton.tsx:

import { Skeleton } from "skelion";
import "skelion/styles.css";

export function CardSkeleton() {
return (
<div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
<Skeleton.Block width="100%" height={160} animation="pulse" />
<Skeleton.Text width="70%" height={18} animation="pulse" />
<Skeleton.Text width="100%" height={14} animation="pulse" />
<Skeleton.Text width="85%" height={14} animation="pulse" />
</div>
);
}

Generate with custom name and animation

npx skelion generate profile --name User --animation shimmer

Creates ./components/skeletons/UserSkeleton.tsx with shimmer animation.

Generate to a custom directory

npx skelion generate table --output ./src/skeletons

Creates ./src/skeletons/TableSkeleton.tsx.