@@ -15,11 +15,11 @@ import {getLoadingState} from '../../private/util';
1515function Accordion ( {
1616 children,
1717 active_item,
18- key,
19- class_name,
20- className,
2118 always_open = false ,
2219 start_collapsed = false ,
20+ class_name,
21+ className,
22+ key,
2323 setProps,
2424 ...otherProps
2525} ) {
@@ -92,76 +92,56 @@ Accordion.dashPersistence = {
9292
9393Accordion . propTypes = {
9494 /**
95- * The ID of this component, used to identify dash components
96- * in callbacks. The ID needs to be unique across all of the
97- * components in an app.
98- */
99- id : PropTypes . string ,
100-
101- /**
102- * The children of this component
95+ * The children of the Accordion.
10396 */
10497 children : PropTypes . node ,
10598
10699 /**
107- * Defines CSS styles which will override styles previously set.
108- */
109- style : PropTypes . object ,
110-
111- /**
112- * Often used with CSS to style elements with common properties.
100+ * The ID of the Accordion.
113101 */
114- class_name : PropTypes . string ,
115-
116- /**
117- * **DEPRECATED** Use `class_name` instead.
118- *
119- * Often used with CSS to style elements with common properties.
120- */
121- className : PropTypes . string ,
122-
123- /**
124- * A unique identifier for the component, used to improve
125- * performance by React.js while rendering components
126- * See https://reactjs.org/docs/lists-and-keys.html for more info
127- */
128- key : PropTypes . string ,
129-
130- /**
131- * Renders accordion edge-to-edge with its parent container
132- */
133- flush : PropTypes . bool ,
102+ id : PropTypes . string ,
134103
135104 /**
136105 * The item_id of the currently active item. If item_id has not been specified
137106 * for the active item, this will default to item-i, where i is the index
138107 * (starting from 0) of the item.
139108 *
140- * If `always_open=True`, this needs to be a list of string IDs.
109+ * If `always_open=True`, then active_item should be a list item_ids of all the
110+ * currently open AccordionItems
141111 */
142112 active_item : PropTypes . oneOfType ( [
143113 PropTypes . string ,
144114 PropTypes . arrayOf ( PropTypes . string )
145115 ] ) ,
146116
147117 /**
148- * You can make accordion items stay open when another item is opened by
149- * using the always_open prop.
118+ * If True, multiple items can be expanded at once.
150119 */
151120 always_open : PropTypes . bool ,
152121
153122 /**
154- * Set to True for all items to be collapsed initially .
123+ * If True, all items will start collapsed.
155124 */
156125 start_collapsed : PropTypes . bool ,
157126
158127 /**
159- * Used to allow user interactions in this component to be persisted when
160- * the component - or the page - is refreshed. If `persisted` is truthy and
161- * hasn't changed from its previous value, a `value` that the user has
162- * changed while using the app will keep that change, as long as
163- * the new `value` also matches what was given originally.
164- * Used in conjunction with `persistence_type`.
128+ * If True the Accordion will be rendered edge-to-edge within its parent container.
129+ */
130+ flush : PropTypes . bool ,
131+
132+ /**
133+ * Additional inline styles to apply to the Accordion
134+ */
135+ style : PropTypes . object ,
136+
137+ /**
138+ * Additional CSS class to apply to the Accordion.
139+ */
140+ class_name : PropTypes . string ,
141+
142+ /**
143+ * Used to allow user interactions to be persisted when the page is refreshed.
144+ * See https://dash.plotly.com/persistence for more details
165145 */
166146 persistence : PropTypes . oneOfType ( [
167147 PropTypes . bool ,
@@ -170,20 +150,34 @@ Accordion.propTypes = {
170150 ] ) ,
171151
172152 /**
173- * Properties whose user interactions will persist after refreshing the
174- * component or the page. Since only `value` is allowed this prop can
153+ * Properties to persist. Since only `active_item` is supported, this prop can
175154 * normally be ignored.
176155 */
177156 persisted_props : PropTypes . arrayOf ( PropTypes . oneOf ( [ 'active_item' ] ) ) ,
178157
179158 /**
180159 * Where persisted user changes will be stored:
181- * memory: only kept in memory, reset on page refresh.
182- * local: window.localStorage, data is kept after the browser quit.
183- * session: window.sessionStorage, data is cleared once the browser quit.
160+ * - memory: only kept in memory, reset on page refresh.
161+ * - local: window.localStorage, data is kept after the browser quit.
162+ * - session: window.sessionStorage, data is cleared once the browser quit.
184163 */
185164 persistence_type : PropTypes . oneOf ( [ 'local' , 'session' , 'memory' ] ) ,
186165
166+ /**
167+ * A unique identifier for the component, used to improve performance by React.js
168+ * while rendering components
169+ *
170+ * See https://react.dev/learn/rendering-lists#why-does-react-need-keys for more info
171+ */
172+ key : PropTypes . string ,
173+
174+ /**
175+ * **DEPRECATED** Use `class_name` instead.
176+ *
177+ * Additional CSS class to apply to the Accordion.
178+ */
179+ className : PropTypes . string ,
180+
187181 /**
188182 * Dash-assigned callback that gets fired when the value changes.
189183 */
0 commit comments