<Columns space="medium"> <Column width="1/4"> <Placeholder height="100%" label="Side bar" /> </Column> <Column> <Stack space="medium"> <Placeholder height={80} shape="round" width={80} /> <Card> <Stack space="small"> <Text weight="strong">Senior Developer</Text> <Text>Sydney</Text> </Stack> </Card> <Placeholder height={80} /> </Stack> </Column> </Columns>
<Stack space="medium"> <Card> <Stack space="small"> <Text weight="strong">Lead Designer</Text> <Text>Melbourne</Text> </Stack> </Card> <Card> <Stack space="small"> <Text weight="strong">Senior Developer</Text> <Text>Sydney</Text> </Stack> </Card> <Card> <Stack space="small"> <Text weight="strong">Product Manager</Text> <Text>Canberra</Text> </Stack> </Card> </Stack>
{setDefaultState("jobs", [ { id: 1, title: "Lead Designer", location: "Melbourne", }, { id: 2, title: "Senior Developer", location: "Sydney", }, { id: 3, title: "Product Manager", location: "Canberra", }, ])} <Stack space="medium"> {getState("jobs").map((job) => ( <Card key={job.id}> <Stack space="small"> <Text weight="strong">{job.title}</Text> <Text>{job.location}</Text> </Stack> </Card> ))} </Stack>
{setDefaultState("jobs", [ { id: 1, title: "Lead Designer", location: "Melbourne", }, { id: 2, featured: true, title: "Senior Developer", location: "Sydney", }, { id: 3, title: "Product Manager", location: "Canberra", }, ])} <Stack space="medium"> {getState("jobs").map((job) => ( <Card key={job.id} tone={job.featured ? "promote" : undefined}> <Stack space="small"> {job.featured && ( <Badge weight="strong" tone="promote"> Featured </Badge> )} <Text weight="strong">{job.title}</Text> <Text>{job.location}</Text> </Stack> </Card> ))} </Stack>
<Stack space="medium"> <Checkbox label="Checkbox" stateName="myCheckbox" /> {getState("myCheckbox") && ( <Notice tone="positive"> <Text>Good job! You checked the checkbox!</Text> </Notice> )} </Stack>
<Stack space="medium"> <Checkbox label="Checkbox" stateName="myCheckbox" /> {getState("myCheckbox") ? ( <Notice tone="positive"> <Text>Good job! You checked the checkbox!</Text> </Notice> ) : ( <Notice tone="critical"> <Text>Oops! You haven’t checked the checkbox!</Text> </Notice> )} </Stack>
{setDefaultState("myCheckbox", true)} <Stack space="medium"> <Checkbox label="Checkbox" stateName="myCheckbox" /> {getState("myCheckbox") ? ( <Notice tone="positive"> <Text>Good job! You checked the checkbox!</Text> </Notice> ) : ( <Notice tone="critical"> <Text>Oops! You haven’t checked the checkbox!</Text> </Notice> )} </Stack>
<Card> <Stack space="large"> <TextField label="First name" stateName="firstName" /> <TextField label="Last name" stateName="lastName" /> {getState("firstName") && getState("lastName") ? ( <Heading level="4"> 👋 Hello {getState("firstName")} {getState("lastName")}! </Heading> ) : null} </Stack> </Card>
<Card> <Actions> <Button onClick={() => toggleState("myDrawer")}>Open drawer</Button> </Actions> <Drawer title="Drawer" stateName="myDrawer"> <Placeholder height={100} /> </Drawer> </Card>
{setDefaultState("screen", "Home")} {getState("screen") === "Home" && ( <Card> <Stack space="large"> <Heading level="3">Home</Heading> <Actions> <Button onClick={() => setState("screen", "Welcome")}>Sign in</Button> </Actions> </Stack> </Card> )} {getState("screen") === "Welcome" && ( <Card> <Stack space="large"> <Heading level="3">👋 Welcome!</Heading> <Placeholder height={100} /> <Actions> <Button onClick={() => resetState("screen")}>Sign out</Button> </Actions> </Stack> </Card> )}
<Box padding="large" borderRadius="standard" background={responsiveValue({ mobile: "customDark", tablet: "customLight", })} style={{ background: responsiveValue({ mobile: vars.backgroundColor.brand, tablet: vars.backgroundColor.surface, }), }} > <Text>Responsive background</Text> </Box>