Skip to content
Ginga UI
Ginga UI
日本語

Getting started

  • Overview
  • Quick start
  • Theme generation
  • Custom rendering
  • All components

Forms

  • Button
  • Checkbox
  • Input
  • Radio
  • Questionnaire
  • SegmentedControl
  • Select
  • ComboBox
  • NumberField
  • SearchField
  • Slider
  • Switch
  • FormControl

Display

  • Accordion
  • Alert
  • AlertDialog
  • Badge
  • CodeBlock
  • Card
  • Dialog
  • Drawer
  • Image
  • List
  • Popover
  • Menu
  • Tooltip
  • Table
  • Tab
  • Toast
  • Trace

Typography

  • Heading
  • Paragraph

Navigation

  • Anchor

Layout

  • Box

Resources

  • Changelog
  • GitHub (opens in a new tab)

Logo: Twemoji (opens in a new tab) (CC-BY 4.0)

List

Displays ordered and unordered lists.

View in Storybook (opens in a new tab)

Installation

import { List } from "@ginga-ui/core";

Unordered list

An example of an unordered list (ul).

  • List item 1
  • List item 2
  • List item 3
list.tsx
import { List, ListItem } from "@ginga-ui/core";

export function UnorderedExample() {
  return (
    <List type="unordered">
      <ListItem>List item 1</ListItem>
      <ListItem>List item 2</ListItem>
      <ListItem>List item 3</ListItem>
    </List>
  );
}

Ordered list

An example of an ordered list (ol).

  1. First step
  2. Second step
  3. Final step
list.tsx
import { List, ListItem } from "@ginga-ui/core";

export function OrderedExample() {
  return (
    <List type="ordered">
      <ListItem>First step</ListItem>
      <ListItem>Second step</ListItem>
      <ListItem>Final step</ListItem>
    </List>
  );
}

Nested list

Nest lists to create a hierarchy.

  • Parent item 1
  • Parent item 2
    • Nested item 1
    • Nested item 2
  • Parent item 3
list.tsx
import { List, ListItem } from "@ginga-ui/core";

export function NestedExample() {
  return (
    <List type="unordered">
      <ListItem>Parent item 1</ListItem>
      <ListItem>
        Parent item 2
        <List type="unordered">
          <ListItem>Nested item 1</ListItem>
          <ListItem>Nested item 2</ListItem>
        </List>
      </ListItem>
      <ListItem>Parent item 3</ListItem>
    </List>
  );
}

Mixed list

A list that combines ordered and unordered lists.

  1. Define requirements for the task management system
  2. UI/UX design
    • Create wireframes
    • Design mockups
    • Usability testing
  3. Development and testing
  4. Deployment
list.tsx
import { List, ListItem } from "@ginga-ui/core";

export function MixedExample() {
  return (
    <List type="ordered">
      <ListItem>Define requirements for the task management system</ListItem>
      <ListItem>
        UI/UX design
        <List type="unordered">
          <ListItem>Create wireframes</ListItem>
          <ListItem>Design mockups</ListItem>
          <ListItem>Usability testing</ListItem>
        </List>
      </ListItem>
      <ListItem>Development and testing</ListItem>
      <ListItem>Deployment</ListItem>
    </List>
  );
}

Props

List

NameTypeDefaultDescription
type"ordered" | "unordered""unordered""ordered" renders an ol element and "unordered" renders a ul element.
render(props) => ReactElement-Replaces the root element. Return an element that receives the given props, such as next/link.

Also accepts the attributes of the HTML ul (opens in a new tab) / ol (opens in a new tab) element.

ListItem

NameTypeDefaultDescription
render(props) => ReactElement-Replaces the root element. Return an element that receives the given props, such as next/link.

Also accepts the attributes of the HTML li (opens in a new tab) element.