mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
76 lines
2.1 KiB
TypeScript
76 lines
2.1 KiB
TypeScript
import {Layout, Box, AcmeLogo, Content, VariantsSelectorWrapper} from "./common";
|
|
|
|
const App = `import React from "react";
|
|
import { Navbar, Button, Link, Text, Card, Radio } from "@nextui-org/react";
|
|
import { Layout } from "./Layout.js";
|
|
import { AcmeLogo } from "./AcmeLogo.js";
|
|
import { VariantsSelectorWrapper } from "./VariantsSelectorWrapper.js";
|
|
|
|
export default function App() {
|
|
const [variant, setVariant] = React.useState("static");
|
|
|
|
const variants = ["static", "floating", "sticky"];
|
|
|
|
return (
|
|
<Layout>
|
|
<Navbar isBordered variant={variant}>
|
|
<Navbar.Brand>
|
|
<AcmeLogo />
|
|
<Text b color="inherit" hideIn="xs">
|
|
ACME
|
|
</Text>
|
|
</Navbar.Brand>
|
|
<Navbar.Content hideIn="xs">
|
|
<Navbar.Link href="#">Features</Navbar.Link>
|
|
<Navbar.Link isActive href="#">Customers</Navbar.Link>
|
|
<Navbar.Link href="#">Pricing</Navbar.Link>
|
|
<Navbar.Link href="#">Company</Navbar.Link>
|
|
</Navbar.Content>
|
|
<Navbar.Content>
|
|
<Navbar.Link color="inherit" href="#">
|
|
Login
|
|
</Navbar.Link>
|
|
<Navbar.Item>
|
|
<Button auto flat as={Link} href="#">
|
|
Sign Up
|
|
</Button>
|
|
</Navbar.Item>
|
|
</Navbar.Content>
|
|
</Navbar>
|
|
<VariantsSelectorWrapper>
|
|
<Card css={{maxW: "50%"}}>
|
|
<Card.Body css={{pt: "$8", px: "$8"}}>
|
|
<Radio.Group
|
|
defaultValue="default"
|
|
label="Select variant"
|
|
orientation="horizontal"
|
|
size="sm"
|
|
value={variant}
|
|
onChange={setVariant}
|
|
>
|
|
{variants.map((variant) => (
|
|
<Radio key={variant} value={variant}>
|
|
{variant}
|
|
</Radio>
|
|
))}
|
|
</Radio.Group>
|
|
</Card.Body>
|
|
</Card>
|
|
</VariantsSelectorWrapper>
|
|
</Layout>
|
|
)
|
|
}`;
|
|
|
|
const react = {
|
|
"/Content.js": Content,
|
|
"/Layout.js": Layout,
|
|
"/AcmeLogo.js": AcmeLogo,
|
|
"/Box.js": Box,
|
|
"/VariantsSelectorWrapper.js": VariantsSelectorWrapper,
|
|
"/App.js": App,
|
|
};
|
|
|
|
export default {
|
|
...react,
|
|
};
|