mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* refactor(core): new forwardRef types created, stories modified, important changes implemented * feat(docs): custom variants api added, components ref fixed * fix(components): omit ref removed
43 lines
899 B
TypeScript
43 lines
899 B
TypeScript
import React from "react";
|
|
import {ComponentMeta} from "@storybook/react";
|
|
import {code} from "@nextui-org/theme";
|
|
|
|
import {Code, CodeProps} from "../src";
|
|
|
|
export default {
|
|
title: "Components/Code",
|
|
component: Code,
|
|
argTypes: {
|
|
color: {
|
|
control: {
|
|
type: "select",
|
|
options: ["default", "primary", "secondary", "success", "warning", "danger"],
|
|
},
|
|
},
|
|
radius: {
|
|
control: {
|
|
type: "select",
|
|
options: ["none", "sm", "md", "lg", "full"],
|
|
},
|
|
},
|
|
size: {
|
|
control: {
|
|
type: "select",
|
|
options: ["sm", "md", "lg"],
|
|
},
|
|
},
|
|
},
|
|
} as ComponentMeta<typeof Code>;
|
|
|
|
const defaultProps = {
|
|
children: "npm install @nextui-org/react",
|
|
...code.defaultVariants,
|
|
};
|
|
|
|
const Template = (args: CodeProps) => <Code {...args} />;
|
|
|
|
export const Default = Template.bind({});
|
|
Default.args = {
|
|
...defaultProps,
|
|
};
|