Performance
Not testedNot tested
Button 20MITButtonShadcn Space
A button React component by Shadcn Space. Collected unchanged from Shadcn Space under the MIT licence and shown here live.
Shown at real size.
The copy starts with the licence notice. Keep it when you use the code.
Quality report
The grade and score come from automated checks run at build or test time. If a check did not run, it is marked Not tested — numbers are never invented.
Not tested
Not tested
Not tested
Not tested
Figures come from an automated script, not from hand-written samples.
Controls · HTML · CSS · JS
Edit the code and tune it with the controls. The preview updates as you type.

:root{--bg:#f6f4f0;--ink:#17181a;--background:40 20% 96%;--foreground:24 10% 8%;--card:0 0% 100%}html,body{min-height:100%;margin:0;background:var(--bg);color:var(--ink)}html,body{height:100%;overflow:hidden}body{display:grid;place-items:center}#root{display:grid;place-items:center;max-width:100%;max-height:100%;box-sizing:border-box;padding:16px;color:hsl(var(--foreground))}#root.full{width:100%;height:100%;padding:0}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-play-state:paused!important;transition-duration:0s!important}}
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-leading:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-amber-400:oklch(82.8% .189 84.429);--color-yellow-400:oklch(85.2% .199 91.936);--color-blue-400:oklch(70.7% .165 254.624);--color-purple-500:oklch(62.7% .265 303.9);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-rose-500:oklch(64.5% .246 16.439);--color-neutral-50:oklch(98.5% 0 none);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-medium:500;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-font-feature-settings:"cv02", "cv03", "cv04", "cv11";--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}html{scroll-behavior:smooth}body{background-color:var(--background);color:var(--foreground)}body:is(.dark *){color:var(--color-white)}h1,h2,h3,h4,h5,h6{font-family:system-ui,sans-serif}.highlight-marker{z-index:1;display:inline-block;position:relative}.highlight-marker:after{content:"";z-index:-1;filter:blur(.3px);transform-origin:0;background:url(//s2.svgbox.net/pen-brushes.svg?ic=brush-1&color=fcea4e);border-radius:4px;height:26px;animation:1s ease-out .3s forwards brushPaint;position:absolute;bottom:0%;left:-10px;right:-10px;transform:scaleX(0)rotate(-1.5deg)}.dark .highlight-marker:after{background:url(//s2.svgbox.net/pen-brushes.svg?ic=brush-1&color=f6bc07af)}@keyframes brushPaint{0%{opacity:.1;transform:scaleX(0)rotate(-1.5deg)}40%{opacity:.1;transform:scaleX(.5)rotate(-1.5deg)}70%{opacity:1;transform:scaleX(1.05)rotate(-1.5deg)}to{transform:scaleX(1)rotate(-1.5deg)}}}@layer components{.shiki.with-line-numbers code{counter-reset:step;counter-increment:step 0}.shiki.with-line-numbers code .line:before{content:counter(step);counter-increment:step;margin-right:calc(var(--spacing) * 6);width:calc(var(--spacing) * 12);background-color:var(--background);padding-right:calc(var(--spacing) * 3);padding-left:calc(var(--spacing) * 4);text-align:right;color:var(--muted-foreground);will-change:transform;display:inline-block;position:sticky;left:0}.dark .shiki.with-line-numbers code .line:before{background-color:var(--shiki-dark-bg)}html.dark .shiki{background-color:#0000!important}html.dark .shiki span{color:var(--shiki-dark)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;text-decoration:var(--shiki-dark-text-decoration)!important}.scroll-offset{scroll-margin-top:80px!important}}@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.gap-3{gap:calc(var(--spacing) * 3)}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:2147483647px}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-border{border-color:var(--border)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-background{background-color:var(--background)}.bg-blue-400{background-color:var(--color-blue-400)}.bg-fuchsia-500{background-color:var(--color-fuchsia-500)}.bg-orange-400{background-color:var(--color-orange-400)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/25{background-color:#fb2c3640}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/25{background-color:color-mix(in oklab, var(--color-red-500) 25%, transparent)}}.bg-rose-500{background-color:var(--color-rose-500)}.bg-yellow-400{background-color:var(--color-yellow-400)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-2{padding-block:calc(var(--spacing) * 2)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-muted-foreground{color:var(--muted-foreground)}.text-red-500{color:var(--color-red-500)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}.dark .shiki{--shiki-dark-bg:var(--background)!important;background-color:#0000!important}.container{max-width:100%;padding-inline:calc(var(--spacing) * 6);margin-inline:auto}@media (min-width:64rem){.container{padding-inline:calc(var(--spacing) * 8)}}@media (min-width:96rem){.container{max-width:1536px}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.5rem;--background:oklch(100% 0 0);--foreground:oklch(12.96% .0274 261.69);--card:oklch(100% 0 0);--card-foreground:oklch(12.96% .0274 261.69);--popover:oklch(100% 0 0);--popover-foreground:oklch(12.96% .0274 261.69);--primary:oklch(12.96% .0274 261.69);--primary-foreground:oklch(92.76% .0058 264.53);--secondary:oklch(96.7% .0029 264.54);--secondary-foreground:oklch(12.96% .0274 261.69);--muted:oklch(96.7% .0029 264.54);--muted-foreground:oklch(44.61% .0263 256.8);--accent:oklch(96.7% .0029 264.54);--accent-foreground:oklch(12.96% .0274 261.69);--destructive:oklch(63.68% .2078 25.33);--border:oklch(92.76% .0058 264.53);--input:oklch(92.2% 0 0);--ring:oklch(71.37% .0192 261.32);--chart-1:oklch(63.681% .20784 25.315);--chart-2:oklch(78.453% .13254 181.95);--chart-3:oklch(62.31% .1881 259.83);--chart-4:oklch(87.896% .15335 91.611);--chart-5:oklch(75.763% .15899 55.922);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(12.96% .0274 261.69);--sidebar-primary:oklch(12.96% .0274 261.69);--sidebar-primary-foreground:oklch(92.76% .0058 264.53);--sidebar-accent:oklch(96.7% .0029 264.54);--sidebar-accent-foreground:oklch(12.96% .0274 261.69);--sidebar-border:oklch(92.76% .0058 264.53);--sidebar-ring:oklch(71.37% .0192 261.32)}.dark{--background:oklch(12.96% .0274 261.69);--foreground:oklch(92.76% .0058 264.53);--card:oklch(12.96% .0274 261.69);--card-foreground:oklch(92.76% .0058 264.53);--popover:oklch(12.96% .0274 261.69);--popover-foreground:oklch(92.76% .0058 264.53);--primary:oklch(92.76% .0058 264.53);--primary-foreground:oklch(12.96% .0274 261.69);--secondary:oklch(37.29% .0306 259.73);--secondary-foreground:oklch(92.76% .0058 264.53);--muted:oklch(27.81% .0296 256.85);--muted-foreground:oklch(87.17% .0093 258.34);--accent:oklch(27.81% .0296 256.85);--accent-foreground:oklch(92.76% .0058 264.53);--destructive:oklch(63.68% .2078 25.33);--border:oklch(27.808% .02963 256.871/.7);--input:oklch(100% 0 0/.15);--ring:oklch(44.61% .0263 256.8);--chart-1:oklch(63.681% .20784 25.315);--chart-2:oklch(78.453% .13254 181.95);--chart-3:oklch(62.31% .1881 259.83);--chart-4:oklch(87.896% .15335 91.611);--chart-5:oklch(75.763% .15899 55.922);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(92.76% .0058 264.53);--sidebar-primary:oklch(92.76% .0058 264.53);--sidebar-primary-foreground:oklch(12.96% .0274 261.69);--sidebar-accent:oklch(27.81% .0296 256.85);--sidebar-accent-foreground:oklch(92.76% .0058 264.53);--sidebar-border:var(--border);--sidebar-ring:oklch(44.61% .0263 256.8)}body{font-family:system-ui,sans-serif}#carbonads{z-index:20;border-top-style:var(--tw-border-style);background-color:var(--color-neutral-50);width:fit-content;padding-block:calc(var(--spacing) * 4);text-align:center;border-top-width:1px;display:none}:is(:where(.group)[data-state=collapsed] #carbonads){display:none}@media (min-width:48rem){#carbonads{display:block}}#carbonads .carbon-wrap img{margin-inline:auto;margin-bottom:calc(var(--spacing) * 4);width:fit-content;max-width:calc(var(--spacing) * 80);border-radius:var(--radius);--tw-border-style:none;border-style:none;flex-direction:column}#carbonads .carbon-text{text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:var(--leading-tight);line-height:var(--leading-tight);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex-basis:auto;display:inline-block}#carbonads .carbon-poweredby{margin-top:calc(var(--spacing) * 2);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted-foreground);text-transform:uppercase;display:block}@media (min-width:80rem){.container{min-width:1330px!important}}@layer documentation{.documentation h1{font-size:var(--text-4xl)!important;line-height:var(--tw-leading,var(--text-4xl--line-height))!important}.documentation h2{font-size:var(--text-3xl)!important;line-height:var(--tw-leading,var(--text-3xl--line-height))!important}.documentation h3{font-size:var(--text-2xl)!important;line-height:var(--tw-leading,var(--text-2xl--line-height))!important}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}This component runs from a bundled build, so its script is read-only here. Edit the HTML and CSS; the full source is in the Code tab.
Edit every component live, tune it with controls, download the full source and copy the advanced prompts.
$49 one-time
Free: preview, copy buttons and the lesson notes.
A clear shape, one strong colour and a short press response make it feel physical.
Primary actions, calls to action and toolbars.
Change the radius, the padding and the length of the hover transition.
Add the "Button 20 (Button)" component from Shadcn Space (github.com/shadcnspace/shadcnspace) (MIT) to my React + Tailwind CSS app. Source file: https://github.com/shadcnspace/shadcnspace/blob/99c2bbb/src/components/shadcn-space/button/button-20.tsx. A clear shape, one strong colour and a short press response make it feel physical. Use it for: Primary actions, calls to action and toolbars. Settings to tune: Change the radius, the padding and the length of the hover transition. Support light and dark themes and respect prefers-reduced-motion. Keep the MIT licence notice.
A longer prompt with tuning, accessibility and integration steps.







