8-bit-pixel-art-patter…
Create pixelated borders, shadows, and effects for 8-bit retro components. Apply when…
Use explicit ternary operators instead of && for conditional rendering. Apply when rendering values that could be 0, NaN, or other falsy values that might render unexpectedly.
$ npx -y skills add theorcdev/8bitcn-ui --skill rendering-conditional-render --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/rendering-conditional-renderContext preview
The summary Claude sees to decide when to auto-load this skill.
Use explicit ternary operators instead of && for conditional rendering. Apply when rendering values that could be 0, NaN, or other falsy values that might render unexpectedly.
name: rendering-conditional-render description: Use explicit ternary operators instead of && for conditional rendering. Apply when rendering values that could be 0, NaN, or other falsy values that might render unexpectedly.
Use explicit ternary operators (`? :`) instead of `&&` for conditional rendering when the condition can be `0`, `NaN`, or other falsy values that render.
**Incorrect (renders "0" when count is 0):**
function Badge({ count }: { count: number }) {
return (
<div>
{count && <span className="badge">{count}</span>}
</div>
)
}
// When count = 0, renders: <div>0</div>
// When count = 5, renders: <div><span class="badge">5</span></div>**Correct (renders nothing when count is 0):**
function Badge({ count }: { count: number }) {
return (
<div>
{count > 0 ? <span className="badge">{count}</span> : null}
</div>
)
}
// When count = 0, renders: <div></div>
// When count = 5, renders: <div><span class="badge">5</span></div>Accessible retro components that you can copy and paste into your apps.Free. Open Source. Built on shadcn/ui. Documentation · Components · Blocks · Themes · Discord
Repo: theorcdev/8bitcn-ui
Create pixelated borders, shadows, and effects for 8-bit retro components. Apply when…
Create documentation with gaming-specific examples, retro styling, and 8-bit terminology.…
Optimize 8-bit animations for smooth performance. Apply when creating animated pixel art,…
Import directly from source files instead of barrel files. Apply when using libraries like…
Use next/dynamic for lazy-loading heavy components. Apply when importing large components…
Best practices for wrapping shadcn/ui components. Apply when creating 8-bit styled variants…