Abdulkader Safi

The LaralCN-UI Figma library: designed from the Blade code, then ahead of it

LaralCN-UI now has a Figma file where every component is a real Figma component with variants, built from the Blade source rather than copied from a shadcn community kit. The first 35 components were drawn from code that already existed. The 7 missing ones were designed before any code, and the code was then built to match the design.

5 min read

Share
The "All components" page of the LaralCN-UI Figma file, with one tile per component laid out in a grid.

LaralCN-UI now has a Figma file where every component is a real Figma component with variants, built from the Blade source rather than copied from a shadcn community kit. The first 35 components were drawn from code that already existed. The 7 missing ones were designed before any code, and the code was then built to match the design.

The design follows the code, not a community kit

There are plenty of shadcn Figma kits around, and the fast option was to duplicate one and rename it. I did not, because those kits draw the React version, and LaralCN-UI has drifted from it in small ways: Blade props instead of React props, a toast with a different API, a sidebar with its own collapse rules, and a lot of logical start/end positioning since the right-to-left work in part 9. A kit would have shown components that do not exist and missed ones that do.

So each Figma component was drawn by reading its .blade.php file in registry/ and matching what it renders: the same variants from its match() block, the same sizes, the same tokens. When the Blade file says variant has six arms, the Figma component set has six variants. That keeps the file honest in the one direction that matters to me: a designer who picks a variant in Figma is picking something php artisan ui:add will actually install.

Foundations: variables taken from the theme tokens

Before any component, the file got its foundations, built from the same theme tokens php artisan ui:init injects into a project's CSS.

  • A Color collection with a Light mode and a Dark mode. Its semantic colours, such as primary or ring, are aliases that point at a set of neutral primitives taken straight from the theme's values.
  • Radius and Spacing variables, so corners and gaps bind to the same scale the Tailwind classes use.
  • Text styles and effect styles for the type scale and the shadows.

Because the colours are aliased per mode, switching a frame from Light to Dark swaps every component on it at once, the same way the .dark class does on the site.

A page per component, and a cover that works

The file has a cover, an "All components" page, an Icons page, and then one page per component. The "All components" page holds a live tile for each component, and those tiles can be previewed in prototype mode, so the page doubles as a quick click-through of the whole library.

Each component page lays out every variant and state side by side and wires up the interactions: clicking a checkbox toggles it, and a dialog trigger opens the dialog. The point was to see behaviour as well as styling before writing or changing any Blade.

I tracked progress in a Notion table with one row per component and two columns, "Figma done" and "Code done". Most rows got their first tick in the Figma column.

Seven components designed before any code

The first pass covered the 35 components that were already in the registry. That pass also made the gaps obvious: next to shadcn's list, LaralCN-UI had no combobox, no command palette, no data table, no date picker, and nothing for file uploads, steppers or a proper toast queue.

Those 7 were designed in Figma first: the combobox, command palette, data table, date picker, file upload, stepper and toast queue. Their pages settled the questions that usually get settled halfway through writing code, like how a range looks in the date picker or how a stack of toasts collapses. The Blade code was then built to those designs. The next few parts cover each one.

Translucent tokens came out solid

The surprise in this work was opacity. The Blade components use translucent token colours all over the place. The progress track, for example:

bg-primary/20

Hover rows use bg-muted/50, and the slider track is bg-primary/20 as well. In Figma I set those up as a fill bound to the primary variable at 20% paint opacity. They rendered solid. Binding a colour variable to a fill drops the paint's own opacity, so the fill showed the full variable colour.

The result looked wrong in ways that took a while to spot. Progress and Slider tracks looked completely full, because the track and the filled part were the same solid colour. Hover rows in menus and tables looked identical to selected rows.

The fix was to stop asking the fill to carry the alpha. The track or background became its own layer, bound to the token at full strength, and that layer got layer opacity instead (20% for a /20 class, 50% for /50). Layer opacity survives the variable binding, so the track reads as a faint band again and hover is lighter than selected.

Gaps I left on purpose

The file is close to the code, not identical, and three differences are known:

  • The focus ring is drawn at full strength. In code it is ring-ring/50, half strength.
  • Button hovers are solid colour swaps, where the code uses /90 on the background.
  • Translucent input fills in dark mode (dark:bg-input/30) are not modelled.

Each of these needs the same layer-opacity treatment as the tracks, spread across many more components. None of them changes what a component is or which variants it has, so I shipped the file without them and noted them here.

Where it is

The Figma file: https://www.figma.com/design/vgdqTAVLthlKyMzK30XfSX/LaralCN-UI

The components themselves install into your Laravel app with:

composer require --dev safi/laralcn-ui
php artisan ui:init
php artisan ui:add button

Docs: https://laralcn-ui.abdulkadersafi.com. GitHub: https://github.com/Abdulkader-Safi/LaralCN-UI. MIT licensed.

Next: the /ar docs were right to left but still in English, and code on production had no colours.

Last updated 1 Dec 2026 · filed under ShadCN, figma, ui, laralcn-ui

Every entry on this project

26 build notes, in order

Including the ones where nothing worked. You are on part 11.

Read the series →

FAQ

Frequently asked questions

Is the Figma file a copy of a shadcn community kit?

No. Every component was drawn from its Blade file in the LaralCN-UI registry, so the variants and states match what php artisan ui:add installs.

Does the Figma file support dark mode?

Yes. The Color collection has Light and Dark modes, and its semantic colours alias neutral primitives taken from the theme tokens, so switching a frame's mode swaps every component on it.

Why do translucent colours like primary/20 look solid in Figma?

Binding a colour variable to a fill drops the paint's opacity. Put the colour on its own layer at full strength and set layer opacity on that layer instead.

Is the Figma file identical to the code?

Nearly. The focus ring is at full strength instead of 50%, button hovers are solid instead of /90, and dark-mode translucent input fills are not modelled yet.

Written by

Abdulkader Safi

Software Engineer

Lead engineer at DSRPT, from Lebanon and based in Kuwait. I write about the tools and bugs from real client work, with the numbers I measured.

About me → GitHub LinkedIn

Need this kind of work done on your project?

Start a project →

Keep reading

More from LaralCN-UI: shadcn-style Blade components and blocks you own

All 26 entries →