OneScript

Section

Organize content into a group with a header and footer.

Section provides header, content, and footer view slots. header and footer accept any OneScript view, component, or view array.

import { HStack, Section, Symbol, Text } from "onescript/views"

<Section
  header={
    <HStack spacing={6}>
      <Symbol name="person.2.fill" />
      <Text>Team</Text>
    </HStack>
  }
  footer={<Text>2 people</Text>}
>
  <Text>Alice</Text>
  <Text>Bob</Text>
</Section>
PropTypeDescription
headerViewChildOptional header content.
footerViewChildOptional footer content.
childrenViewChildThe section's body content.

Use pinnedViews in a LazyVStack, LazyHStack, LazyVGrid, or LazyHGrid to keep section headers or footers pinned while scrolling.

How is this guide?

Last updated on