mcpField
U
ui-components

ui-components

github.com/elie222Design & UI12.9k94 installsUpdated today
Repository

About ui-components

A skill providing UI implementation conventions for Shadcn UI, Tailwind CSS, SWR, and common loading and form components. It is intended for developers building responsive interfaces and fetching API data.

Key features

  1. 01Shadcn UI and Tailwind styling guidance
  2. 02Mobile-first responsive design
  3. 03SWR patterns for API GET requests
  4. 04Loading state component guidance
  5. 05Form input examples

Use cases

  1. 01Build responsive UI components
  2. 02Fetch paginated API data
  3. 03Implement loading states and forms

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/elie222/inbox-zero --skill ui-components

After installing, type/ui-componentsin Claude Code to confirm it loaded.

Details

From the project README

UI Components and Styling

UI Framework

  • Use Shadcn UI and Tailwind for components and styling
  • Implement responsive design with Tailwind CSS using a mobile-first approach
  • Use next/image package for images

Install new Shadcn components

pnpm dlx shadcn@latest add COMPONENT

Example:

pnpm dlx shadcn@latest add progress

Data Fetching with SWR

For API get requests to server use the swr package:

const searchParams = useSearchParams();
const page = searchParams.get("page") || "1";
const { data, isLoading, error } = useSWR<PlanHistoryResponse>(
  `/api/user/planned/history?page=${page}`
);

Loading Components

Use the LoadingContent component to handle loading states:

<Card>
  <LoadingContent loading={isLoading} error={error}>
    {data && <MyComponent data={data} />}
  </LoadingContent>
</Card>

Form Components

Text Inputs
<Input
  type="email"
  name="email"
  label="Email"
  registerProps={register("email", { required: true })}
  error={errors.email}
/>
Text Area
<Input
  type="text"
  autosizeTextarea
  rows={3}
  name="message"
  placeholder="Paste in email content"
  registerProps={register("message", { required: true })}
  error={errors.message}
/>

Comments

Markdown supported