
vscode-shadcn-ui-snippets
A (now deprecated) VSCode extension providing snippets to quickly import and use shadcn-ui components. Successor is shadcn/next.

Streamline shadcn-ui Development with VSCode Snippets (Deprecated)
This VSCode extension, shadcn/ui snippets, aimed to simplify working with shadcn-ui components. Please note, this extension is deprecated and has been moved to shadcn/next; users should install the new version for updates. It allowed developers to type prefixes like 'cn' or 'shadcn' in JSX/TSX files for instant access to component snippets. This tool automated import statements and provided boilerplate JSX/TSX, speeding up development with shadcn-ui.
Features:
- Snippet Activation: Trigger component snippets by typing
cn
orshadcn
in JSX/TSX files. - Import Snippets (
cni-[component]
): Automatically adds import statements for specified shadcn-ui components. - JSX/TSX Usage Snippets (
cnx-[component]
): Provides boilerplate code structure for using shadcn-ui components. - Page-Based Component Snippets (
cnp-[component]
): Offers snippets for larger, page-specific components like forms. - Help Snippet (
cn-help
): Displays instructions on how to use the snippets within the extension. - Alert Component Example:
cni-alert
for imports,cnx-alert
for JSX structure. - Form Page Component Example:
cnp-form
generates a client-side form withzod
,react-hook-form
, and shadcn-ui form elements. - Contribution System: Allowed users to contribute new component snippets by creating markdown files and running a generation script (
bun run generate
). - Multi-Word Component Support: Handled multi-word component names (e.g.,
hover-card.md
) for snippet organization. - Deprecation Notice: Clearly informs users that this extension is deprecated and directs them to the
shadcn/next
extension for the latest updates and features.
Summary:
shadcn/ui snippets was a VSCode extension designed to accelerate development with shadcn-ui by offering code snippets for easy component integration. It automated imports and JSX/TSX boilerplate via simple prefixes. This extension is now deprecated; developers should migrate to the shadcn/next
extension for ongoing support and the latest features. It was particularly useful for quickly adding UI elements, including complex forms, into React projects utilizing shadcn-ui.

Similar to vscode-shadcn-ui-snippets:


