@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
41 lines (40 loc) • 1.51 kB
TypeScript
/**
* This module includes a section UI control, to be used for organizing UI controls into
* collapsible sections.
*
* To be able to use these controls the CanKingDataProvider component must be present in the
* component tree above your component. Normally the CanKingDataProvider is added
* at the root of the component tree.
*
* @packageDocumentation
*/
import React, { JSX } from 'react';
/**
* Properties of the SectionControl React component.
*/
export interface SectionControlProps {
/** Text alignment to used in the divider. */
textAlign?: 'center' | 'right' | 'left';
/** Text to be displayed in the divider. */
text?: string;
/** A summary that will be added to text when the section is collapsed. */
summary?: string;
/** Children that will be included in this section. */
children?: React.ReactNode;
/** Sets to true if this section should be collapsible. */
collapsible?: boolean;
/** The current collapsed state. */
collapsed?: boolean;
/**
* Callback that will be called when this section has been collpsed or expanded.
* @param value - The new collapsed state.
*/
collapsedChange?: (value: boolean) => void;
}
/**
* Creates a section control.
* @param props - Component properties.
* @returns The SectionControl React component.
*/
declare function SectionControl({ textAlign, text, summary, children, collapsible, collapsed, collapsedChange, }: SectionControlProps): JSX.Element;
export default SectionControl;