Description list
DescriptionList
component enables users to organize information and is commonly used to
display metadata in key-value pairs.Basic usage
Task backed
DescriptionList
can be backed by an Airplane task rather than setting the items
prop. Set the
task
prop to call an Airplane task. The items are automatically
inferred from the output of the Task.- A list of objects, where each object has a
term
anddescription
property, e.g.[{term: "Name", description: "John Doe"}]
. - An object where the keys are the
term
and the values are thedescription
, e.g.{Name: "John Doe"}
.
Customizing data
DescriptionList
, use outputTransform
to convert the output. This prop is a function that receives the task output and returns new items.Component API
Name | Description | Default |
---|---|---|
items | { term: React.ReactNode; description: React.ReactNode; }[] List of terms and descriptions. | |
align | "start" | "end" | "center" Alignment of the term and description. | start |
loading | boolean Renders a loading state when true. | |
width | SizingToken | "{number}px" Defines the width of the component. | auto |
height | SizingToken | "{number}px" Defines the height of the component. | auto |
grow | boolean If true, the element will grow to fill available space.
This prop works only if the element is a direct child of a Stack. | |
task | string |
AirplaneFunc |
SlugQuery |
FunctionQuery The task query to execute when this component loads. The component's data will be populated by the task's output and loading and error states will be handled automatically. If the task doesn't require any parameters or special options, you can just pass the task slug ( If the task does require parameters or special options, pass the task as an object. If you are using a slug, specify the SlugQuery FunctionQuery The The The | |
outputTransform | (output: TOutput) => { term: React.ReactNode; description: React.ReactNode; }[] | Record<string, React.ReactNode> Callback to transform the task output before it populates the description list items. |