Creates a key-value component for displaying labeled data with optional icons and extra information.
Configuration object
A JSX element representing the key-value component
Basic usage with static content
keyValue({ label: 'Username', value: 'john.doe'}); Copy
keyValue({ label: 'Username', value: 'john.doe'});
Usage with dynamic content from central state
keyValue({ label: 'Current User', value: (state) => `${state.user.firstName} ${state.user.lastName}`, extra: (state) => `Last login: ${state.user.lastLogin}`}); Copy
keyValue({ label: 'Current User', value: (state) => `${state.user.firstName} ${state.user.lastName}`, extra: (state) => `Last login: ${state.user.lastLogin}`});
Usage with icon and horizontal layout
keyValue({ icon: 'user', label: 'Account Status', value: 'Active', layout: 'horizontal'}); Copy
keyValue({ icon: 'user', label: 'Account Status', value: 'Active', layout: 'horizontal'});
Creates a key-value component for displaying labeled data with optional icons and extra information.