Button Plain
Button Plain primitive
Install
npx ui8kit add button-plainPulls in: kit-button, recipes, utils
Preview
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add button-plaincompose/ButtonPlain.svelte
<!-- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. -->
<!-- ButtonPlain: Button + recipe button-plain. -->
<script lang="ts">
import type { ComponentProps, Snippet } from "svelte";
import Prim from "../kit/ui/button/Button.svelte";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
let { class: className, children, ...rest }: ComponentProps<typeof Prim> & { class?: string; children?: Snippet } = $props();
const cls = $derived(cn(rc("button-plain", { }), className));
</script>
<Prim class={cls} {...rest}>{@render children?.()}</Prim>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add button-plaincompose/button-plain.tsx
// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
import type { ComponentProps } from "react";
import { Button as Prim } from "../kit/ui/button/button";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
export type ButtonPlainProps = Omit<ComponentProps<typeof Prim>, "tag"> & { className?: string };
/** ButtonPlain: Button + recipe button-plain. */
export function ButtonPlain({ className, ...rest }: ButtonPlainProps) {
return <Prim className={cn(rc("button-plain", { }), className)} {...rest} />;
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add button-plaincompose/ButtonPlain.vue
<!-- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. -->
<!-- ButtonPlain: Button + recipe button-plain. -->
<script setup lang="ts">
import { computed, useAttrs } from "vue";
import Prim from "../kit/ui/button/Button.vue";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
defineOptions({ name: "ButtonPlain", inheritAttrs: false });
const props = defineProps<{ }>();
const attrs = useAttrs();
const rest = computed(() => {
const { class: _class, ...r } = attrs;
return r;
});
const cls = computed(() => cn(rc("button-plain", { }), attrs.class as string | undefined));
const tagValue = computed(() => "");
</script>
<template>
<Prim :class="cls" v-bind="rest"><slot /></Prim>
</template>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add button-plaincompose/button-plain.solid.tsx
// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
import { splitProps, type ComponentProps } from "solid-js";
import { Button as Prim } from "../kit/ui/button/button.solid";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
export type ButtonPlainProps = Omit<ComponentProps<typeof Prim>, "tag" | "class" | "className"> & { class?: string; className?: string };
/** ButtonPlain: Button + recipe button-plain. */
export function ButtonPlain(props: ButtonPlainProps) {
const [local, rest] = splitProps(props, ["class", "className"]);
return <Prim class={cn(rc("button-plain", { }), local.class ?? local.className)} {...rest} />;
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdnnpx ui8kit add button-plaincompose/button-plain.templ
// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
package compose
import "github.com/ui8kit/codegen/generated/templ/ui/button"
// ButtonPlainProps: ButtonPlain: Button + recipe button-plain.
type ButtonPlainProps struct {
button.ButtonProps
}
func buttonPlainInner(p ButtonPlainProps) button.ButtonProps {
in := p.ButtonProps
in.Class = Join(Rc("button-plain", map[string]string{}), p.ButtonProps.Class)
return in
}
// ButtonPlain renders Button with the composition classes.
templ ButtonPlain(p ButtonPlainProps) {
@button.Button(buttonPlainInner(p)) {
{ children... }
}
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdnnpx ui8kit add button-plaincompose/ButtonPlain.html.twig
{# Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. #}
{# ButtonPlain: Button + recipe button-plain. Params: class, attrs + the params of Button. #}
{% include 'ui/button/Button.html.twig' with compose_props('ButtonPlain', _context) only %}Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdnnpx ui8kit add button-plaincompose/ButtonPlain.latte
{* Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. *}
{* ButtonPlain: Button + recipe button-plain. *}
{parameters
string $class = '',
string $type = '',
?string $form = null,
string $href = '',
bool $disabled = false,
?bool $pressed = null,
?bool $expanded = null,
?string $ariaLabel = null,
?string $ariaPressed = null,
?string $ariaExpanded = null,
?string $ariaControls = null,
array $attrs = [],
string $children = '',
}
{include '../ui/button/Button.latte', ...\CodegenX\Compose\Latte\Compose::props('ButtonPlain', ['class' => $class, 'type' => $type, 'form' => $form, 'href' => $href, 'disabled' => $disabled, 'pressed' => $pressed, 'expanded' => $expanded, 'ariaLabel' => $ariaLabel, 'ariaPressed' => $ariaPressed, 'ariaExpanded' => $ariaExpanded, 'ariaControls' => $ariaControls, 'attrs' => $attrs, 'children' => $children])}Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdnnpx ui8kit add button-plaincompose/button-plain.html.j2
{#- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
ButtonPlain: Button + recipe button-plain. Props (p): Class, Attrs + the props of Button. -#}
{%- with p = compose_props('ButtonPlain', p) %}{% include 'ui/button/button.html.j2' %}{% endwith %}Props
Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.
No props.