forked from twidi/mixt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.html
1253 lines (1116 loc) · 654 KB
/
api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><html lang="en"><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>API - MIXT documentation (version 1.2.3)</title><link rel="stylesheet" type="text/css" href="typeset.css" /><link rel="stylesheet" type="text/css" href="global.css" /><style type="text/css">
</style><body><nav id="main-menu" class="menu"><p><a href="#top">Table of content</a></p><ul><li><details><summary><a href="#PropTypes" class="menu-PropTypes">PropTypes</a></summary><ul><li><details><summary><a href="#PropTypes-types" class="menu-PropTypes-types">Special types</a></summary><ul><li><details><summary><a href="#PropTypes-types-Required" class="menu-value menu-value-named">Required</a></summary><ul><li><a href="#PropTypes-types-Required-example" class="menu-value-example">Example</a></li></ul></details></li><li><details><summary><a href="#PropTypes-types-Choices" class="menu-value menu-value-named">Choices</a></summary><ul><li><a href="#PropTypes-types-Choices-example" class="menu-value-example">Example</a></li></ul></details></li><li><details><summary><a href="#PropTypes-types-DefaultChoices" class="menu-value menu-value-named">DefaultChoices</a></summary><ul><li><a href="#PropTypes-types-DefaultChoices-example" class="menu-value-example">Example</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#PropTypes-values" class="menu-PropTypes-values">Special values</a></summary><ul><li><details><summary><a href="#PropTypes-values-Booleans" class="menu-value menu-value-named">Booleans</a></summary><ul><li><a href="#PropTypes-values-Booleans-example" class="menu-value-example">Example</a></li></ul></details></li><li><details><summary><a href="#PropTypes-values-Numbers" class="menu-value menu-value-named">Numbers</a></summary><ul><li><a href="#PropTypes-values-Numbers-example" class="menu-value-example">Example</a></li></ul></details></li><li><details><summary><a href="#PropTypes-values-None" class="menu-value menu-value-named">None</a></summary><ul><li><a href="#PropTypes-values-None-example" class="menu-value-example">Example</a></li></ul></details></li><li><details><summary><a href="#PropTypes-values-NotProvided" class="menu-value menu-value-named">NotProvided</a></summary><ul><li><a href="#PropTypes-values-NotProvided-example" class="menu-value-example">Example</a></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#class-Element" class="menu-class">Element</a></summary><ul><li><details><summary><a href="#class-Element-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><details><summary><a href="#class-Element-prop_types-props" class="menu-prop_types-props">Props</a></summary><ul><li><a href="#class-Element-prop_types-props-ref" class="menu-value menu-value-named">ref</a></li><li><a href="#class-Element-prop_types-props-id" class="menu-value menu-value-named">id</a></li><li><a href="#class-Element-prop_types-props-_class" class="menu-value menu-value-named">_class</a></li></ul></details></li><li><a href="#class-Element-prop_types-example" class="menu-prop_types-example">Example</a></li></ul></details></li><li><a href="#class-Element-example" class="menu-class-example">Example</a></li><li><details><summary><a href="#class-Element-attributes" class="menu-class-attributes">Attributes</a></summary><ul><li><a href="#class-Element-attributes-__tag__" class="menu-value menu-value-named">__tag__</a></li><li><a href="#class-Element-attributes-__display_name__" class="menu-value menu-value-named">__display_name__</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods" class="menu-class-methods">Methods</a></summary><ul><li><details><summary><a href="#class-Element-methods-prop" class="menu-function menu-function-method">prop</a></summary><ul><li><details><summary><a href="#class-Element-methods-prop-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prop-arguments-name" class="menu-value menu-value-named">name</a></li><li><a href="#class-Element-methods-prop-arguments-default" class="menu-value menu-value-named">default</a></li></ul></details></li><li><a href="#class-Element-methods-prop-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prop-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-prop-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prop_name" class="menu-function menu-function-classmethod">prop_name</a></summary><ul><li><details><summary><a href="#class-Element-methods-prop_name-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prop_name-arguments-name" class="menu-value menu-value-named">name</a></li></ul></details></li><li><a href="#class-Element-methods-prop_name-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prop_name-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-prop_name-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-has_prop" class="menu-function menu-function-method">has_prop</a></summary><ul><li><details><summary><a href="#class-Element-methods-has_prop-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-has_prop-arguments-name" class="menu-value menu-value-named">name</a></li><li><a href="#class-Element-methods-has_prop-arguments-allow_invalid" class="menu-value menu-value-named">allow_invalid</a></li></ul></details></li><li><a href="#class-Element-methods-has_prop-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-has_prop-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-has_prop-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-set_prop" class="menu-function menu-function-method">set_prop</a></summary><ul><li><details><summary><a href="#class-Element-methods-set_prop-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-set_prop-arguments-name" class="menu-value menu-value-named">name</a></li><li><a href="#class-Element-methods-set_prop-arguments-value" class="menu-value menu-value-named">value</a></li></ul></details></li><li><a href="#class-Element-methods-set_prop-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-set_prop-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-set_prop-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-unset_prop" class="menu-function menu-function-method">unset_prop</a></summary><ul><li><details><summary><a href="#class-Element-methods-unset_prop-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-unset_prop-arguments-name" class="menu-value menu-value-named">name</a></li></ul></details></li><li><a href="#class-Element-methods-unset_prop-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-unset_prop-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-unset_prop-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prop_default" class="menu-function menu-function-method">prop_default</a></summary><ul><li><details><summary><a href="#class-Element-methods-prop_default-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prop_default-arguments-name" class="menu-value menu-value-named">name</a></li></ul></details></li><li><a href="#class-Element-methods-prop_default-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prop_default-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-prop_default-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-is_prop_default" class="menu-function menu-function-method">is_prop_default</a></summary><ul><li><details><summary><a href="#class-Element-methods-is_prop_default-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-is_prop_default-arguments-name" class="menu-value menu-value-named">name</a></li><li><a href="#class-Element-methods-is_prop_default-arguments-value" class="menu-value menu-value-named">value</a></li></ul></details></li><li><a href="#class-Element-methods-is_prop_default-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-is_prop_default-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-is_prop_default-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prop_type" class="menu-function menu-function-classmethod">prop_type</a></summary><ul><li><details><summary><a href="#class-Element-methods-prop_type-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prop_type-arguments-name" class="menu-value menu-value-named">name</a></li></ul></details></li><li><a href="#class-Element-methods-prop_type-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prop_type-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-prop_type-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-is_prop_required" class="menu-function menu-function-classmethod">is_prop_required</a></summary><ul><li><details><summary><a href="#class-Element-methods-is_prop_required-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-is_prop_required-arguments-name" class="menu-value menu-value-named">name</a></li></ul></details></li><li><a href="#class-Element-methods-is_prop_required-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-is_prop_required-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-is_prop_required-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-set_props" class="menu-function menu-function-method">set_props</a></summary><ul><li><details><summary><a href="#class-Element-methods-set_props-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-set_props-arguments-props" class="menu-value menu-value-named">props</a></li></ul></details></li><li><a href="#class-Element-methods-set_props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-set_props-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-set_props-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-props" class="menu-function menu-function-property">props</a></summary><ul><li><a href="#class-Element-methods-props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-props-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-props_for" class="menu-function menu-function-method">props_for</a></summary><ul><li><details><summary><a href="#class-Element-methods-props_for-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-props_for-arguments-component" class="menu-value menu-value-named">component</a></li></ul></details></li><li><a href="#class-Element-methods-props_for-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-props_for-raises" class="menu-function-raises">Raises</a></li><li><a href="#class-Element-methods-props_for-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-declared_props" class="menu-function menu-function-property">declared_props</a></summary><ul><li><a href="#class-Element-methods-declared_props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-declared_props-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-non_declared_props" class="menu-function menu-function-property">non_declared_props</a></summary><ul><li><a href="#class-Element-methods-non_declared_props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-non_declared_props-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prefixed_props" class="menu-function menu-function-method">prefixed_props</a></summary><ul><li><details><summary><a href="#class-Element-methods-prefixed_props-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prefixed_props-arguments-prefix" class="menu-value menu-value-named">prefix</a></li></ul></details></li><li><a href="#class-Element-methods-prefixed_props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prefixed_props-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-to_string" class="menu-function menu-function-method">to_string</a></summary><ul><li><a href="#class-Element-methods-to_string-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-to_string-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-children" class="menu-function menu-function-method">children</a></summary><ul><li><details><summary><a href="#class-Element-methods-children-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-children-arguments-selector" class="menu-value menu-value-named">selector</a></li><li><a href="#class-Element-methods-children-arguments-exclude" class="menu-value menu-value-named">exclude</a></li></ul></details></li><li><a href="#class-Element-methods-children-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-children-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-append" class="menu-function menu-function-method">append</a></summary><ul><li><details><summary><a href="#class-Element-methods-append-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-append-arguments-child_or_children" class="menu-value menu-value-named">child_or_children</a></li></ul></details></li><li><a href="#class-Element-methods-append-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-append-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prepend" class="menu-function menu-function-method">prepend</a></summary><ul><li><details><summary><a href="#class-Element-methods-prepend-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prepend-arguments-child_or_children" class="menu-value menu-value-named">child_or_children</a></li></ul></details></li><li><a href="#class-Element-methods-prepend-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prepend-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-remove" class="menu-function menu-function-method">remove</a></summary><ul><li><details><summary><a href="#class-Element-methods-remove-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-remove-arguments-child_or_children" class="menu-value menu-value-named">child_or_children</a></li></ul></details></li><li><a href="#class-Element-methods-remove-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-remove-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-add_class" class="menu-function menu-function-method">add_class</a></summary><ul><li><details><summary><a href="#class-Element-methods-add_class-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-add_class-arguments-klass" class="menu-value menu-value-named">klass</a></li><li><a href="#class-Element-methods-add_class-arguments-prepend" class="menu-value menu-value-named">prepend</a></li></ul></details></li><li><a href="#class-Element-methods-add_class-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-add_class-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-append_class" class="menu-function menu-function-method">append_class</a></summary><ul><li><details><summary><a href="#class-Element-methods-append_class-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-append_class-arguments-klass" class="menu-value menu-value-named">klass</a></li></ul></details></li><li><a href="#class-Element-methods-append_class-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-append_class-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prepend_class" class="menu-function menu-function-method">prepend_class</a></summary><ul><li><details><summary><a href="#class-Element-methods-prepend_class-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prepend_class-arguments-klass" class="menu-value menu-value-named">klass</a></li></ul></details></li><li><a href="#class-Element-methods-prepend_class-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prepend_class-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-remove_class" class="menu-function menu-function-method">remove_class</a></summary><ul><li><details><summary><a href="#class-Element-methods-remove_class-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-remove_class-arguments-klass" class="menu-value menu-value-named">klass</a></li></ul></details></li><li><a href="#class-Element-methods-remove_class-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-remove_class-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-has_class" class="menu-function menu-function-method">has_class</a></summary><ul><li><details><summary><a href="#class-Element-methods-has_class-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-has_class-arguments-klass" class="menu-value menu-value-named">klass</a></li></ul></details></li><li><a href="#class-Element-methods-has_class-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-has_class-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-classes" class="menu-function menu-function-property">classes</a></summary><ul><li><a href="#class-Element-methods-classes-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-classes-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-render" class="menu-function menu-function-method">render</a></summary><ul><li><details><summary><a href="#class-Element-methods-render-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-render-arguments-context" class="menu-value menu-value-named">context</a></li></ul></details></li><li><a href="#class-Element-methods-render-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-render-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-prerender" class="menu-function menu-function-method">prerender</a></summary><ul><li><details><summary><a href="#class-Element-methods-prerender-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-prerender-arguments-context" class="menu-value menu-value-named">context</a></li></ul></details></li><li><a href="#class-Element-methods-prerender-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-prerender-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-postrender" class="menu-function menu-function-method">postrender</a></summary><ul><li><details><summary><a href="#class-Element-methods-postrender-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-postrender-arguments-element" class="menu-value menu-value-named">element</a></li><li><a href="#class-Element-methods-postrender-arguments-context" class="menu-value menu-value-named">context</a></li></ul></details></li><li><a href="#class-Element-methods-postrender-returns" class="menu-function-returns">Returns</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-postrender_child_element" class="menu-function menu-function-method">postrender_child_element</a></summary><ul><li><details><summary><a href="#class-Element-methods-postrender_child_element-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-Element-methods-postrender_child_element-arguments-child" class="menu-value menu-value-named">child</a></li><li><a href="#class-Element-methods-postrender_child_element-arguments-child_element" class="menu-value menu-value-named">child_element</a></li><li><a href="#class-Element-methods-postrender_child_element-arguments-context" class="menu-value menu-value-named">context</a></li></ul></details></li><li><a href="#class-Element-methods-postrender_child_element-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-postrender_child_element-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-Element-methods-add_ref" class="menu-function menu-function-method">add_ref</a></summary><ul><li><a href="#class-Element-methods-add_ref-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-Element-methods-add_ref-example" class="menu-function-example">Example</a></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#class-ElementProxy" class="menu-class">ElementProxy</a></summary><ul><li><details><summary><a href="#class-ElementProxy-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#class-ElementProxy-prop_types-props-ref" class="menu-value menu-value-named">ref</a></li><li><a href="#class-ElementProxy-prop_types-props-id" class="menu-value menu-value-named">id</a></li><li><a href="#class-ElementProxy-prop_types-props-_class" class="menu-value menu-value-named">_class</a></li></ul></details></li><li><a href="#class-ElementProxy-example" class="menu-class-example">Example</a></li><li><details><summary><a href="#class-ElementProxy-attributes" class="menu-class-attributes">Attributes</a></summary><ul><li><a href="#class-ElementProxy-attributes-proxied" class="menu-value menu-value-named">proxied</a></li></ul></details></li><li><details><summary><a href="#class-ElementProxy-methods" class="menu-class-methods">Methods</a></summary><ul><li><details><summary><a href="#class-ElementProxy-methods-For" class="menu-function menu-function-classmethod">For</a></summary><ul><li><details><summary><a href="#class-ElementProxy-methods-For-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#class-ElementProxy-methods-For-arguments-component" class="menu-value menu-value-named">component</a></li></ul></details></li><li><a href="#class-ElementProxy-methods-For-returns" class="menu-function-returns">Returns</a></li></ul></details></li><li><details><summary><a href="#class-ElementProxy-methods-proxied_props" class="menu-function menu-function-property">proxied_props</a></summary><ul><li><a href="#class-ElementProxy-methods-proxied_props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-ElementProxy-methods-proxied_props-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#class-ElementProxy-methods-own_props" class="menu-function menu-function-property">own_props</a></summary><ul><li><a href="#class-ElementProxy-methods-own_props-returns" class="menu-function-returns">Returns</a></li><li><a href="#class-ElementProxy-methods-own_props-example" class="menu-function-example">Example</a></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#class-Ref" class="menu-class">Ref</a></summary><ul><li><a href="#class-Ref-example" class="menu-class-example">Example</a></li><li><details><summary><a href="#class-Ref-methods" class="menu-class-methods">Methods</a></summary><ul><li><details><summary><a href="#class-Ref-methods-current" class="menu-function menu-function-property">current</a></summary><ul><li><a href="#class-Ref-methods-current-returns" class="menu-function-returns">Returns</a></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#module-dev_mode" class="menu-module">dev_mode</a></summary><ul><li><a href="#module-dev_mode-example" class="menu-module-example">Example</a></li><li><details><summary><a href="#module-dev_mode-functions" class="menu-module-functions">Functions</a></summary><ul><li><details><summary><a href="#module-dev_mode-functions-set_dev_mode" class="menu-function menu-function-function">set_dev_mode</a></summary><ul><li><details><summary><a href="#module-dev_mode-functions-set_dev_mode-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#module-dev_mode-functions-set_dev_mode-arguments-dev_mode" class="menu-value menu-value-named">dev_mode</a></li></ul></details></li><li><a href="#module-dev_mode-functions-set_dev_mode-returns" class="menu-function-returns">Returns</a></li><li><a href="#module-dev_mode-functions-set_dev_mode-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#module-dev_mode-functions-unset_dev_mode" class="menu-function menu-function-function">unset_dev_mode</a></summary><ul><li><a href="#module-dev_mode-functions-unset_dev_mode-returns" class="menu-function-returns">Returns</a></li><li><a href="#module-dev_mode-functions-unset_dev_mode-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#module-dev_mode-functions-override_dev_mode" class="menu-function menu-function-function">override_dev_mode</a></summary><ul><li><details><summary><a href="#module-dev_mode-functions-override_dev_mode-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#module-dev_mode-functions-override_dev_mode-arguments-dev_mode" class="menu-value menu-value-named">dev_mode</a></li></ul></details></li><li><a href="#module-dev_mode-functions-override_dev_mode-returns" class="menu-function-returns">Returns</a></li><li><a href="#module-dev_mode-functions-override_dev_mode-example" class="menu-function-example">Example</a></li></ul></details></li><li><details><summary><a href="#module-dev_mode-functions-in_dev_mode" class="menu-function menu-function-function">in_dev_mode</a></summary><ul><li><a href="#module-dev_mode-functions-in_dev_mode-returns" class="menu-function-returns">Returns</a></li><li><a href="#module-dev_mode-functions-in_dev_mode-example" class="menu-function-example">Example</a></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#Context" class="menu-Context">Context</a></summary><ul><li><a href="#Context-example" class="menu-Context-example">Example</a></li></ul></details></li><li><details><summary><a href="#module-collectors" class="menu-module">collectors</a></summary><ul><li><details><summary><a href="#module-collectors-classes" class="menu-module-classes">Classes</a></summary><ul><li><details><summary><a href="#module-collectors-classes-class-CSSCollector" class="menu-class">CSSCollector</a></summary><ul><li><details><summary><a href="#module-collectors-classes-class-CSSCollector-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-ref" class="menu-value menu-value-named">ref</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-id" class="menu-value menu-value-named">id</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-_class" class="menu-value menu-value-named">_class</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-render_position" class="menu-value menu-value-named">render_position</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-reuse" class="menu-value menu-value-named">reuse</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-reuse_global" class="menu-value menu-value-named">reuse_global</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-reuse_non_global" class="menu-value menu-value-named">reuse_non_global</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-reuse_namespaces" class="menu-value menu-value-named">reuse_namespaces</a></li><li><a href="#module-collectors-classes-class-CSSCollector-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#module-collectors-classes-class-JSCollector" class="menu-class">JSCollector</a></summary><ul><li><details><summary><a href="#module-collectors-classes-class-JSCollector-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-ref" class="menu-value menu-value-named">ref</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-id" class="menu-value menu-value-named">id</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-_class" class="menu-value menu-value-named">_class</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-render_position" class="menu-value menu-value-named">render_position</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-reuse" class="menu-value menu-value-named">reuse</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-reuse_global" class="menu-value menu-value-named">reuse_global</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-reuse_non_global" class="menu-value menu-value-named">reuse_non_global</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-reuse_namespaces" class="menu-value menu-value-named">reuse_namespaces</a></li><li><a href="#module-collectors-classes-class-JSCollector-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags" class="menu-HtmlTags">HTML tags</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-_Base" class="menu-class">_Base</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-_Base-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ref" class="menu-value menu-value-named">ref</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-id" class="menu-value menu-value-named">id</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-_class" class="menu-value menu-value-named">_class</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-accesskey" class="menu-value menu-value-named">accesskey</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-autocapitalize" class="menu-value menu-value-named">autocapitalize</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-contenteditable" class="menu-value menu-value-named">contenteditable</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-contextmenu" class="menu-value menu-value-named">contextmenu</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-dir" class="menu-value menu-value-named">dir</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-draggable" class="menu-value menu-value-named">draggable</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-dropzone" class="menu-value menu-value-named">dropzone</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-hidden" class="menu-value menu-value-named">hidden</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-itemid" class="menu-value menu-value-named">itemid</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-itemprop" class="menu-value menu-value-named">itemprop</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-itemscope" class="menu-value menu-value-named">itemscope</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-itemstype" class="menu-value menu-value-named">itemstype</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-lang" class="menu-value menu-value-named">lang</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-slot" class="menu-value menu-value-named">slot</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-spellcheck" class="menu-value menu-value-named">spellcheck</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-style" class="menu-value menu-value-named">style</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-tabindex" class="menu-value menu-value-named">tabindex</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-title" class="menu-value menu-value-named">title</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-translate" class="menu-value menu-value-named">translate</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onabort" class="menu-value menu-value-named">onabort</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onautocomplete" class="menu-value menu-value-named">onautocomplete</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onautocompleteerror" class="menu-value menu-value-named">onautocompleteerror</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onblur" class="menu-value menu-value-named">onblur</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oncancel" class="menu-value menu-value-named">oncancel</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oncanplay" class="menu-value menu-value-named">oncanplay</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oncanplaythrough" class="menu-value menu-value-named">oncanplaythrough</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onchange" class="menu-value menu-value-named">onchange</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onclick" class="menu-value menu-value-named">onclick</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onclose" class="menu-value menu-value-named">onclose</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oncontextmenu" class="menu-value menu-value-named">oncontextmenu</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oncuechange" class="menu-value menu-value-named">oncuechange</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondblclick" class="menu-value menu-value-named">ondblclick</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondrag" class="menu-value menu-value-named">ondrag</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondragend" class="menu-value menu-value-named">ondragend</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondragenter" class="menu-value menu-value-named">ondragenter</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondragexit" class="menu-value menu-value-named">ondragexit</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondragleave" class="menu-value menu-value-named">ondragleave</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondragover" class="menu-value menu-value-named">ondragover</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondragstart" class="menu-value menu-value-named">ondragstart</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondrop" class="menu-value menu-value-named">ondrop</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ondurationchange" class="menu-value menu-value-named">ondurationchange</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onemptied" class="menu-value menu-value-named">onemptied</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onended" class="menu-value menu-value-named">onended</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onerror" class="menu-value menu-value-named">onerror</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onfocus" class="menu-value menu-value-named">onfocus</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oninput" class="menu-value menu-value-named">oninput</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-oninvalid" class="menu-value menu-value-named">oninvalid</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onkeydown" class="menu-value menu-value-named">onkeydown</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onkeypress" class="menu-value menu-value-named">onkeypress</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onkeyup" class="menu-value menu-value-named">onkeyup</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onload" class="menu-value menu-value-named">onload</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onloadeddata" class="menu-value menu-value-named">onloadeddata</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onloadedmetadata" class="menu-value menu-value-named">onloadedmetadata</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onloadstart" class="menu-value menu-value-named">onloadstart</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmousedown" class="menu-value menu-value-named">onmousedown</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmouseenter" class="menu-value menu-value-named">onmouseenter</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmouseleave" class="menu-value menu-value-named">onmouseleave</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmousemove" class="menu-value menu-value-named">onmousemove</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmouseout" class="menu-value menu-value-named">onmouseout</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmouseover" class="menu-value menu-value-named">onmouseover</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmouseup" class="menu-value menu-value-named">onmouseup</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onmousewheel" class="menu-value menu-value-named">onmousewheel</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onpause" class="menu-value menu-value-named">onpause</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onplay" class="menu-value menu-value-named">onplay</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onplaying" class="menu-value menu-value-named">onplaying</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onprogress" class="menu-value menu-value-named">onprogress</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onratechange" class="menu-value menu-value-named">onratechange</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onreset" class="menu-value menu-value-named">onreset</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onresize" class="menu-value menu-value-named">onresize</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onscroll" class="menu-value menu-value-named">onscroll</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onseeked" class="menu-value menu-value-named">onseeked</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onseeking" class="menu-value menu-value-named">onseeking</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onselect" class="menu-value menu-value-named">onselect</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onshow" class="menu-value menu-value-named">onshow</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onsort" class="menu-value menu-value-named">onsort</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onstalled" class="menu-value menu-value-named">onstalled</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onsubmit" class="menu-value menu-value-named">onsubmit</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onsuspend" class="menu-value menu-value-named">onsuspend</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ontimeupdate" class="menu-value menu-value-named">ontimeupdate</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-ontoggle" class="menu-value menu-value-named">ontoggle</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onvolumechange" class="menu-value menu-value-named">onvolumechange</a></li><li><a href="#HtmlTags-tags-class-_Base-prop_types-props-onwaiting" class="menu-value menu-value-named">onwaiting</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-_Hyperlink" class="menu-class">_Hyperlink</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-_Hyperlink-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-_Hyperlink-prop_types-props-download" class="menu-value menu-value-named">download</a></li><li><a href="#HtmlTags-tags-class-_Hyperlink-prop_types-props-href" class="menu-value menu-value-named">href</a></li><li><a href="#HtmlTags-tags-class-_Hyperlink-prop_types-props-hreflang" class="menu-value menu-value-named">hreflang</a></li><li><a href="#HtmlTags-tags-class-_Hyperlink-prop_types-props-referrerpolicy" class="menu-value menu-value-named">referrerpolicy</a></li><li><a href="#HtmlTags-tags-class-_Hyperlink-prop_types-props-rel" class="menu-value menu-value-named">rel</a></li><li><a href="#HtmlTags-tags-class-_Hyperlink-prop_types-props-target" class="menu-value menu-value-named">target</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-A" class="menu-class">A</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-A-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-A-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-A-prop_types-props-ping" class="menu-value menu-value-named">ping</a></li><li><a href="#HtmlTags-tags-class-A-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Abbr" class="menu-class">Abbr</a></li><li><a href="#HtmlTags-tags-class-Address" class="menu-class">Address</a></li><li><details><summary><a href="#HtmlTags-tags-class-Area" class="menu-class">Area</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Area-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Area-prop_types-props-alt" class="menu-value menu-value-named">alt</a></li><li><a href="#HtmlTags-tags-class-Area-prop_types-props-coords" class="menu-value menu-value-named">coords</a></li><li><a href="#HtmlTags-tags-class-Area-prop_types-props-media" class="menu-value menu-value-named">media</a></li><li><a href="#HtmlTags-tags-class-Area-prop_types-props-shape" class="menu-value menu-value-named">shape</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Article" class="menu-class">Article</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Article-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Article-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Aside" class="menu-class">Aside</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Aside-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Aside-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-_Media" class="menu-class">_Media</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-_Media-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-autoplay" class="menu-value menu-value-named">autoplay</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-controls" class="menu-value menu-value-named">controls</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-crossorigin" class="menu-value menu-value-named">crossorigin</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-loop" class="menu-value menu-value-named">loop</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-muted" class="menu-value menu-value-named">muted</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-preload" class="menu-value menu-value-named">preload</a></li><li><a href="#HtmlTags-tags-class-_Media-prop_types-props-src" class="menu-value menu-value-named">src</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Audio" class="menu-class">Audio</a></li><li><details><summary><a href="#HtmlTags-tags-class-B" class="menu-class">B</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-B-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-B-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Base" class="menu-class">Base</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Base-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Base-prop_types-props-href" class="menu-value menu-value-named">href</a></li><li><a href="#HtmlTags-tags-class-Base-prop_types-props-target" class="menu-value menu-value-named">target</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Bdi" class="menu-class">Bdi</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Bdi-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Bdi-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Bdo" class="menu-class">Bdo</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Bdo-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Bdo-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Blockquote" class="menu-class">Blockquote</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Blockquote-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Blockquote-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Blockquote-prop_types-props-cite" class="menu-value menu-value-named">cite</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Body" class="menu-class">Body</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Body-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onafterprint" class="menu-value menu-value-named">onafterprint</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onbeforeprint" class="menu-value menu-value-named">onbeforeprint</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onbeforeunload" class="menu-value menu-value-named">onbeforeunload</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onhashchange" class="menu-value menu-value-named">onhashchange</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onlanguagechange" class="menu-value menu-value-named">onlanguagechange</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onmessage" class="menu-value menu-value-named">onmessage</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onoffline" class="menu-value menu-value-named">onoffline</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-ononline" class="menu-value menu-value-named">ononline</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onpopstate" class="menu-value menu-value-named">onpopstate</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onredo" class="menu-value menu-value-named">onredo</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onstorage" class="menu-value menu-value-named">onstorage</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onundo" class="menu-value menu-value-named">onundo</a></li><li><a href="#HtmlTags-tags-class-Body-prop_types-props-onunload" class="menu-value menu-value-named">onunload</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Br" class="menu-class">Br</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Br-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Br-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Button" class="menu-class">Button</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Button-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Button-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-autofocus" class="menu-value menu-value-named">autofocus</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-autocomplete" class="menu-value menu-value-named">autocomplete</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-formaction" class="menu-value menu-value-named">formaction</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-formenctype" class="menu-value menu-value-named">formenctype</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-formmethod" class="menu-value menu-value-named">formmethod</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-formnovalidate" class="menu-value menu-value-named">formnovalidate</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-formtarget" class="menu-value menu-value-named">formtarget</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-type" class="menu-value menu-value-named">type</a></li><li><a href="#HtmlTags-tags-class-Button-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Canvas" class="menu-class">Canvas</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Canvas-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Canvas-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Canvas-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-Canvas-prop_types-props-width" class="menu-value menu-value-named">width</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Caption" class="menu-class">Caption</a></li><li><details><summary><a href="#HtmlTags-tags-class-Cite" class="menu-class">Cite</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Cite-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Cite-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Code" class="menu-class">Code</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Code-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Code-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Col" class="menu-class">Col</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Col-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Col-prop_types-props-span" class="menu-value menu-value-named">span</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Colgroup" class="menu-class">Colgroup</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Colgroup-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Colgroup-prop_types-props-span" class="menu-value menu-value-named">span</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Data" class="menu-class">Data</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Data-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Data-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Datalist" class="menu-class">Datalist</a></li><li><a href="#HtmlTags-tags-class-Dd" class="menu-class">Dd</a></li><li><details><summary><a href="#HtmlTags-tags-class-Del" class="menu-class">Del</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Del-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Del-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Del-prop_types-props-cite" class="menu-value menu-value-named">cite</a></li><li><a href="#HtmlTags-tags-class-Del-prop_types-props-datetime" class="menu-value menu-value-named">datetime</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Details" class="menu-class">Details</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Details-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Details-prop_types-props-open" class="menu-value menu-value-named">open</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Dfn" class="menu-class">Dfn</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Dfn-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Dfn-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Div" class="menu-class">Div</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Div-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Div-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Dl" class="menu-class">Dl</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Dl-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Dl-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Dt" class="menu-class">Dt</a></li><li><details><summary><a href="#HtmlTags-tags-class-Em" class="menu-class">Em</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Em-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Em-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Embed" class="menu-class">Embed</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Embed-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Embed-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Embed-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-Embed-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-Embed-prop_types-props-type" class="menu-value menu-value-named">type</a></li><li><a href="#HtmlTags-tags-class-Embed-prop_types-props-widht" class="menu-value menu-value-named">widht</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Fieldset" class="menu-class">Fieldset</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Fieldset-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Fieldset-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Fieldset-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Fieldset-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Fieldset-prop_types-props-name" class="menu-value menu-value-named">name</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Figcaption" class="menu-class">Figcaption</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Figcaption-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Figcaption-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Figure" class="menu-class">Figure</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Figure-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Figure-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Footer" class="menu-class">Footer</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Footer-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Footer-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Form" class="menu-class">Form</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Form-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Form-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-accept_charset" class="menu-value menu-value-named">accept_charset</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-action" class="menu-value menu-value-named">action</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-autocomplete" class="menu-value menu-value-named">autocomplete</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-enctype" class="menu-value menu-value-named">enctype</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-method" class="menu-value menu-value-named">method</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Form-prop_types-props-target" class="menu-value menu-value-named">target</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-H" class="menu-class">H</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-H-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-H-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-H-prop_types-props-level" class="menu-value menu-value-named">level</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-H1" class="menu-class">H1</a></li><li><a href="#HtmlTags-tags-class-H2" class="menu-class">H2</a></li><li><a href="#HtmlTags-tags-class-H3" class="menu-class">H3</a></li><li><a href="#HtmlTags-tags-class-H4" class="menu-class">H4</a></li><li><a href="#HtmlTags-tags-class-H5" class="menu-class">H5</a></li><li><a href="#HtmlTags-tags-class-H6" class="menu-class">H6</a></li><li><a href="#HtmlTags-tags-class-Head" class="menu-class">Head</a></li><li><details><summary><a href="#HtmlTags-tags-class-Header" class="menu-class">Header</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Header-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Header-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Hr" class="menu-class">Hr</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Hr-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Hr-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Html" class="menu-class">Html</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Html-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Html-prop_types-props-xmlns" class="menu-value menu-value-named">xmlns</a></li><li><a href="#HtmlTags-tags-class-Html-prop_types-props-xmlns__og" class="menu-value menu-value-named">xmlns__og</a></li><li><a href="#HtmlTags-tags-class-Html-prop_types-props-xmlns__fb" class="menu-value menu-value-named">xmlns__fb</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-I" class="menu-class">I</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-I-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-I-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Iframe" class="menu-class">Iframe</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Iframe-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-allowfullscreen" class="menu-value menu-value-named">allowfullscreen</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-allowpaymentrequest" class="menu-value menu-value-named">allowpaymentrequest</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-referrerpolicy" class="menu-value menu-value-named">referrerpolicy</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-sandbox" class="menu-value menu-value-named">sandbox</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-srcdoc" class="menu-value menu-value-named">srcdoc</a></li><li><a href="#HtmlTags-tags-class-Iframe-prop_types-props-width" class="menu-value menu-value-named">width</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Img" class="menu-class">Img</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Img-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Img-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-alt" class="menu-value menu-value-named">alt</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-crossorigin" class="menu-value menu-value-named">crossorigin</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-decoding" class="menu-value menu-value-named">decoding</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-ismap" class="menu-value menu-value-named">ismap</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-referrerpolicy" class="menu-value menu-value-named">referrerpolicy</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-sizes" class="menu-value menu-value-named">sizes</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-srcset" class="menu-value menu-value-named">srcset</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-width" class="menu-value menu-value-named">width</a></li><li><a href="#HtmlTags-tags-class-Img-prop_types-props-usemap" class="menu-value menu-value-named">usemap</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Input" class="menu-class">Input</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Input-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Input-prop_types-props-type" class="menu-value menu-value-named">type</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-autocomplete" class="menu-value menu-value-named">autocomplete</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-autofocus" class="menu-value menu-value-named">autofocus</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-formaction" class="menu-value menu-value-named">formaction</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-formenctype" class="menu-value menu-value-named">formenctype</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-formmethod" class="menu-value menu-value-named">formmethod</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-formnovalidate" class="menu-value menu-value-named">formnovalidate</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-formtarget" class="menu-value menu-value-named">formtarget</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-_list" class="menu-value menu-value-named">_list</a></li><li><a href="#HtmlTags-tags-class-Input-prop_types-props-name" class="menu-value menu-value-named">name</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-_KeyboardInput" class="menu-class">_KeyboardInput</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-inputmode" class="menu-value menu-value-named">inputmode</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-minlength" class="menu-value menu-value-named">minlength</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-maxlength" class="menu-value menu-value-named">maxlength</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-pattern" class="menu-value menu-value-named">pattern</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-placeholder" class="menu-value menu-value-named">placeholder</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-readonly" class="menu-value menu-value-named">readonly</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-required" class="menu-value menu-value-named">required</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-size" class="menu-value menu-value-named">size</a></li><li><a href="#HtmlTags-tags-class-_KeyboardInput-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputButton" class="menu-class">InputButton</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputButton-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputButton-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputCheckbox" class="menu-class">InputCheckbox</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputCheckbox-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputCheckbox-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-InputCheckbox-prop_types-props-checked" class="menu-value menu-value-named">checked</a></li><li><a href="#HtmlTags-tags-class-InputCheckbox-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputImage" class="menu-class">InputImage</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputImage-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputImage-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-InputImage-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-InputImage-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-InputImage-prop_types-props-width" class="menu-value menu-value-named">width</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputRadio" class="menu-class">InputRadio</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputRadio-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputRadio-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-InputRadio-prop_types-props-checked" class="menu-value menu-value-named">checked</a></li><li><a href="#HtmlTags-tags-class-InputRadio-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputColor" class="menu-class">InputColor</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputColor-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputColor-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputDate" class="menu-class">InputDate</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputDate-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputDate-prop_types-props-min" class="menu-value menu-value-named">min</a></li><li><a href="#HtmlTags-tags-class-InputDate-prop_types-props-max" class="menu-value menu-value-named">max</a></li><li><a href="#HtmlTags-tags-class-InputDate-prop_types-props-readonly" class="menu-value menu-value-named">readonly</a></li><li><a href="#HtmlTags-tags-class-InputDate-prop_types-props-required" class="menu-value menu-value-named">required</a></li><li><a href="#HtmlTags-tags-class-InputDate-prop_types-props-step" class="menu-value menu-value-named">step</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputDateTimeLocal" class="menu-class">InputDateTimeLocal</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputDateTimeLocal-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputDateTimeLocal-prop_types-props-min" class="menu-value menu-value-named">min</a></li><li><a href="#HtmlTags-tags-class-InputDateTimeLocal-prop_types-props-max" class="menu-value menu-value-named">max</a></li><li><a href="#HtmlTags-tags-class-InputDateTimeLocal-prop_types-props-readonly" class="menu-value menu-value-named">readonly</a></li><li><a href="#HtmlTags-tags-class-InputDateTimeLocal-prop_types-props-required" class="menu-value menu-value-named">required</a></li><li><a href="#HtmlTags-tags-class-InputDateTimeLocal-prop_types-props-step" class="menu-value menu-value-named">step</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputEmail" class="menu-class">InputEmail</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputEmail-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputEmail-prop_types-props-multiple" class="menu-value menu-value-named">multiple</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputFile" class="menu-class">InputFile</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputFile-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputFile-prop_types-props-accept" class="menu-value menu-value-named">accept</a></li><li><a href="#HtmlTags-tags-class-InputFile-prop_types-props-capture" class="menu-value menu-value-named">capture</a></li><li><a href="#HtmlTags-tags-class-InputFile-prop_types-props-multiple" class="menu-value menu-value-named">multiple</a></li><li><a href="#HtmlTags-tags-class-InputFile-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-InputHidden" class="menu-class">InputHidden</a></li><li><details><summary><a href="#HtmlTags-tags-class-InputMonth" class="menu-class">InputMonth</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputMonth-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputMonth-prop_types-props-readonly" class="menu-value menu-value-named">readonly</a></li><li><a href="#HtmlTags-tags-class-InputMonth-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-InputNumber" class="menu-class">InputNumber</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputNumber-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputNumber-prop_types-props-min" class="menu-value menu-value-named">min</a></li><li><a href="#HtmlTags-tags-class-InputNumber-prop_types-props-max" class="menu-value menu-value-named">max</a></li><li><a href="#HtmlTags-tags-class-InputNumber-prop_types-props-step" class="menu-value menu-value-named">step</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-InputPassword" class="menu-class">InputPassword</a></li><li><details><summary><a href="#HtmlTags-tags-class-InputRange" class="menu-class">InputRange</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputRange-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputRange-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-InputReset" class="menu-class">InputReset</a></li><li><a href="#HtmlTags-tags-class-InputSearch" class="menu-class">InputSearch</a></li><li><a href="#HtmlTags-tags-class-InputSubmit" class="menu-class">InputSubmit</a></li><li><a href="#HtmlTags-tags-class-InputTel" class="menu-class">InputTel</a></li><li><a href="#HtmlTags-tags-class-InputText" class="menu-class">InputText</a></li><li><a href="#HtmlTags-tags-class-InputUrl" class="menu-class">InputUrl</a></li><li><details><summary><a href="#HtmlTags-tags-class-InputWeek" class="menu-class">InputWeek</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-InputWeek-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-InputWeek-prop_types-props-readonly" class="menu-value menu-value-named">readonly</a></li><li><a href="#HtmlTags-tags-class-InputWeek-prop_types-props-required" class="menu-value menu-value-named">required</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Ins" class="menu-class">Ins</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Ins-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Ins-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Ins-prop_types-props-cite" class="menu-value menu-value-named">cite</a></li><li><a href="#HtmlTags-tags-class-Ins-prop_types-props-datetime" class="menu-value menu-value-named">datetime</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Kbd" class="menu-class">Kbd</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Kbd-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Kbd-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Label" class="menu-class">Label</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Label-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Label-prop_types-props-_for" class="menu-value menu-value-named">_for</a></li><li><a href="#HtmlTags-tags-class-Label-prop_types-props-form" class="menu-value menu-value-named">form</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Legend" class="menu-class">Legend</a></li><li><details><summary><a href="#HtmlTags-tags-class-Li" class="menu-class">Li</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Li-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Li-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Li-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Link" class="menu-class">Link</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Link-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Link-prop_types-props-_as" class="menu-value menu-value-named">_as</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-crossorigin" class="menu-value menu-value-named">crossorigin</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-href" class="menu-value menu-value-named">href</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-hreflang" class="menu-value menu-value-named">hreflang</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-integrity" class="menu-value menu-value-named">integrity</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-media" class="menu-value menu-value-named">media</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-prefetch" class="menu-value menu-value-named">prefetch</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-referrerpolicy" class="menu-value menu-value-named">referrerpolicy</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-rel" class="menu-value menu-value-named">rel</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-sizes" class="menu-value menu-value-named">sizes</a></li><li><a href="#HtmlTags-tags-class-Link-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Main" class="menu-class">Main</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Main-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Main-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Map" class="menu-class">Map</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Map-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Map-prop_types-props-name" class="menu-value menu-value-named">name</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Mark" class="menu-class">Mark</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Mark-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Mark-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Meta" class="menu-class">Meta</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Meta-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Meta-prop_types-props-charset" class="menu-value menu-value-named">charset</a></li><li><a href="#HtmlTags-tags-class-Meta-prop_types-props-content" class="menu-value menu-value-named">content</a></li><li><a href="#HtmlTags-tags-class-Meta-prop_types-props-http_equiv" class="menu-value menu-value-named">http_equiv</a></li><li><a href="#HtmlTags-tags-class-Meta-prop_types-props-name" class="menu-value menu-value-named">name</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Meter" class="menu-class">Meter</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Meter-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-value" class="menu-value menu-value-named">value</a></li><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-min" class="menu-value menu-value-named">min</a></li><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-max" class="menu-value menu-value-named">max</a></li><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-low" class="menu-value menu-value-named">low</a></li><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-high" class="menu-value menu-value-named">high</a></li><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-optimum" class="menu-value menu-value-named">optimum</a></li><li><a href="#HtmlTags-tags-class-Meter-prop_types-props-form" class="menu-value menu-value-named">form</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Nav" class="menu-class">Nav</a></li><li><a href="#HtmlTags-tags-class-Noscript" class="menu-class">Noscript</a></li><li><details><summary><a href="#HtmlTags-tags-class-Object" class="menu-class">Object</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Object-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Object-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-data" class="menu-value menu-value-named">data</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-type" class="menu-value menu-value-named">type</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-typemustmatch" class="menu-value menu-value-named">typemustmatch</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-usemap" class="menu-value menu-value-named">usemap</a></li><li><a href="#HtmlTags-tags-class-Object-prop_types-props-width" class="menu-value menu-value-named">width</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Ol" class="menu-class">Ol</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Ol-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Ol-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Ol-prop_types-props-reversed" class="menu-value menu-value-named">reversed</a></li><li><a href="#HtmlTags-tags-class-Ol-prop_types-props-start" class="menu-value menu-value-named">start</a></li><li><a href="#HtmlTags-tags-class-Ol-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Optgroup" class="menu-class">Optgroup</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Optgroup-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Optgroup-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Optgroup-prop_types-props-label" class="menu-value menu-value-named">label</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Option" class="menu-class">Option</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Option-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Option-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Option-prop_types-props-label" class="menu-value menu-value-named">label</a></li><li><a href="#HtmlTags-tags-class-Option-prop_types-props-selected" class="menu-value menu-value-named">selected</a></li><li><a href="#HtmlTags-tags-class-Option-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Output" class="menu-class">Output</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Output-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Output-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Output-prop_types-props-_for" class="menu-value menu-value-named">_for</a></li><li><a href="#HtmlTags-tags-class-Output-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Output-prop_types-props-name" class="menu-value menu-value-named">name</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-P" class="menu-class">P</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-P-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-P-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Param" class="menu-class">Param</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Param-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Param-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Param-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Picture" class="menu-class">Picture</a></li><li><details><summary><a href="#HtmlTags-tags-class-Pre" class="menu-class">Pre</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Pre-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Pre-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Progress" class="menu-class">Progress</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Progress-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Progress-prop_types-props-max" class="menu-value menu-value-named">max</a></li><li><a href="#HtmlTags-tags-class-Progress-prop_types-props-value" class="menu-value menu-value-named">value</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Q" class="menu-class">Q</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Q-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Q-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Q-prop_types-props-cite" class="menu-value menu-value-named">cite</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Rp" class="menu-class">Rp</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Rp-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Rp-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Rt" class="menu-class">Rt</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Rt-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Rt-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Rtc" class="menu-class">Rtc</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Rtc-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Rtc-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Ruby" class="menu-class">Ruby</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Ruby-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Ruby-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-S" class="menu-class">S</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-S-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-S-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Samp" class="menu-class">Samp</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Samp-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Samp-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Script" class="menu-class">Script</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Script-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Script-prop_types-props-_async" class="menu-value menu-value-named">_async</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-crossorigin" class="menu-value menu-value-named">crossorigin</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-defer" class="menu-value menu-value-named">defer</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-integrity" class="menu-value menu-value-named">integrity</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-nomodule" class="menu-value menu-value-named">nomodule</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-nonce" class="menu-value menu-value-named">nonce</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-Script-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Section" class="menu-class">Section</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Section-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Section-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Select" class="menu-class">Select</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Select-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Select-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-autofocus" class="menu-value menu-value-named">autofocus</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-multiple" class="menu-value menu-value-named">multiple</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-required" class="menu-value menu-value-named">required</a></li><li><a href="#HtmlTags-tags-class-Select-prop_types-props-size" class="menu-value menu-value-named">size</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Slot" class="menu-class">Slot</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Slot-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Slot-prop_types-props-name" class="menu-value menu-value-named">name</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Source" class="menu-class">Source</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Source-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Source-prop_types-props-sizes" class="menu-value menu-value-named">sizes</a></li><li><a href="#HtmlTags-tags-class-Source-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-Source-prop_types-props-srccet" class="menu-value menu-value-named">srccet</a></li><li><a href="#HtmlTags-tags-class-Source-prop_types-props-type" class="menu-value menu-value-named">type</a></li><li><a href="#HtmlTags-tags-class-Source-prop_types-props-media" class="menu-value menu-value-named">media</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Span" class="menu-class">Span</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Span-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Span-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Strong" class="menu-class">Strong</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Strong-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Strong-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Style" class="menu-class">Style</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Style-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Style-prop_types-props-media" class="menu-value menu-value-named">media</a></li><li><a href="#HtmlTags-tags-class-Style-prop_types-props-nonce" class="menu-value menu-value-named">nonce</a></li><li><a href="#HtmlTags-tags-class-Style-prop_types-props-type" class="menu-value menu-value-named">type</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Sub" class="menu-class">Sub</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Sub-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Sub-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Summary" class="menu-class">Summary</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Summary-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Summary-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Sup" class="menu-class">Sup</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Sup-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Sup-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Table" class="menu-class">Table</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Table-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Table-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Tbody" class="menu-class">Tbody</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Tbody-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Tbody-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Td" class="menu-class">Td</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Td-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Td-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Td-prop_types-props-colspan" class="menu-value menu-value-named">colspan</a></li><li><a href="#HtmlTags-tags-class-Td-prop_types-props-headers" class="menu-value menu-value-named">headers</a></li><li><a href="#HtmlTags-tags-class-Td-prop_types-props-rowspan" class="menu-value menu-value-named">rowspan</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Template" class="menu-class">Template</a></li><li><details><summary><a href="#HtmlTags-tags-class-Textarea" class="menu-class">Textarea</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Textarea-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-autocomplete" class="menu-value menu-value-named">autocomplete</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-autofocus" class="menu-value menu-value-named">autofocus</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-cols" class="menu-value menu-value-named">cols</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-disabled" class="menu-value menu-value-named">disabled</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-form" class="menu-value menu-value-named">form</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-maxlength" class="menu-value menu-value-named">maxlength</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-minlength" class="menu-value menu-value-named">minlength</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-name" class="menu-value menu-value-named">name</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-placeholder" class="menu-value menu-value-named">placeholder</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-readonly" class="menu-value menu-value-named">readonly</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-required" class="menu-value menu-value-named">required</a></li><li><a href="#HtmlTags-tags-class-Textarea-prop_types-props-wrap" class="menu-value menu-value-named">wrap</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Tfoot" class="menu-class">Tfoot</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Tfoot-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Tfoot-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Th" class="menu-class">Th</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Th-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Th-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Th-prop_types-props-abbr" class="menu-value menu-value-named">abbr</a></li><li><a href="#HtmlTags-tags-class-Th-prop_types-props-colspan" class="menu-value menu-value-named">colspan</a></li><li><a href="#HtmlTags-tags-class-Th-prop_types-props-headers" class="menu-value menu-value-named">headers</a></li><li><a href="#HtmlTags-tags-class-Th-prop_types-props-rowspan" class="menu-value menu-value-named">rowspan</a></li><li><a href="#HtmlTags-tags-class-Th-prop_types-props-scope" class="menu-value menu-value-named">scope</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Thead" class="menu-class">Thead</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Thead-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Thead-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Time" class="menu-class">Time</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Time-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Time-prop_types-props-role" class="menu-value menu-value-named">role</a></li><li><a href="#HtmlTags-tags-class-Time-prop_types-props-datetime" class="menu-value menu-value-named">datetime</a></li></ul></details></li></ul></details></li><li><a href="#HtmlTags-tags-class-Title" class="menu-class">Title</a></li><li><details><summary><a href="#HtmlTags-tags-class-Tr" class="menu-class">Tr</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Tr-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Tr-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Track" class="menu-class">Track</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Track-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Track-prop_types-props-default" class="menu-value menu-value-named">default</a></li><li><a href="#HtmlTags-tags-class-Track-prop_types-props-kind" class="menu-value menu-value-named">kind</a></li><li><a href="#HtmlTags-tags-class-Track-prop_types-props-label" class="menu-value menu-value-named">label</a></li><li><a href="#HtmlTags-tags-class-Track-prop_types-props-src" class="menu-value menu-value-named">src</a></li><li><a href="#HtmlTags-tags-class-Track-prop_types-props-srclang" class="menu-value menu-value-named">srclang</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-U" class="menu-class">U</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-U-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-U-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Ul" class="menu-class">Ul</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Ul-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Ul-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Var" class="menu-class">Var</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Var-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Var-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Video" class="menu-class">Video</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Video-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Video-prop_types-props-height" class="menu-value menu-value-named">height</a></li><li><a href="#HtmlTags-tags-class-Video-prop_types-props-poster" class="menu-value menu-value-named">poster</a></li><li><a href="#HtmlTags-tags-class-Video-prop_types-props-width" class="menu-value menu-value-named">width</a></li><li><a href="#HtmlTags-tags-class-Video-prop_types-props-playsinline" class="menu-value menu-value-named">playsinline</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlTags-tags-class-Wbr" class="menu-class">Wbr</a></summary><ul><li><details><summary><a href="#HtmlTags-tags-class-Wbr-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlTags-tags-class-Wbr-prop_types-props-role" class="menu-value menu-value-named">role</a></li></ul></details></li></ul></details></li></ul></details></li><li><details><summary><a href="#HtmlUtils" class="menu-HtmlUtils">HTML utils</a></summary><ul><li><details><summary><a href="#HtmlUtils-class-RawHtml" class="menu-class">RawHtml</a></summary><ul><li><details><summary><a href="#HtmlUtils-class-RawHtml-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlUtils-class-RawHtml-prop_types-props-text" class="menu-value menu-value-named">text</a></li></ul></details></li><li><a href="#HtmlUtils-class-RawHtml-example" class="menu-class-example">Example</a></li></ul></details></li><li><details><summary><a href="#HtmlUtils-Raw" class="menu-function menu-function-function">Raw</a></summary><ul><li><details><summary><a href="#HtmlUtils-Raw-arguments" class="menu-function-arguments">Arguments</a></summary><ul><li><a href="#HtmlUtils-Raw-arguments-text" class="menu-value menu-value-named">text</a></li></ul></details></li><li><a href="#HtmlUtils-Raw-returns" class="menu-function-returns">Returns</a></li></ul></details></li><li><details><summary><a href="#HtmlUtils-class-Fragment" class="menu-class">Fragment</a></summary><ul><li><a href="#HtmlUtils-class-Fragment-example" class="menu-class-example">Example</a></li></ul></details></li><li><details><summary><a href="#HtmlUtils-if-else" class="menu-HtmlUtils-if-else">if / else tags</a></summary><ul><li><a href="#HtmlUtils-if-else-example" class="menu-HtmlUtils-if-else-example">Example</a></li></ul></details></li><li><details><summary><a href="#HtmlUtils-comments" class="menu-HtmlUtils-comments">Comments</a></summary><ul><li><a href="#HtmlUtils-if-else-example" class="menu-HtmlUtils-if-else-example">Example</a></li></ul></details></li><li><details><summary><a href="#HtmlUtils-class-Doctype" class="menu-class">Doctype</a></summary><ul><li><details><summary><a href="#HtmlUtils-class-Doctype-prop_types" class="menu-prop_types">PropTypes</a></summary><ul><li><a href="#HtmlUtils-class-Doctype-prop_types-props-doctype" class="menu-value menu-value-named">doctype</a></li></ul></details></li><li><a href="#HtmlUtils-class-Doctype-example" class="menu-class-example">Example</a></li></ul></details></li></ul></details></li><li><details><summary><a href="#module-exceptions" class="menu-module">exceptions</a></summary><ul><li><details><summary><a href="#module-exceptions-classes" class="menu-module-classes">Classes</a></summary><ul><li><a href="#module-exceptions-classes-class-MixtException" class="menu-class">MixtException</a></li><li><a href="#module-exceptions-classes-class-ElementError" class="menu-class">ElementError</a></li><li><a href="#module-exceptions-classes-class-PropError" class="menu-class">PropError</a></li><li><a href="#module-exceptions-classes-class-PropTypeError" class="menu-class">PropTypeError</a></li><li><a href="#module-exceptions-classes-class-PropTypeChoicesError" class="menu-class">PropTypeChoicesError</a></li><li><a href="#module-exceptions-classes-class-PropTypeRequiredError" class="menu-class">PropTypeRequiredError</a></li><li><a href="#module-exceptions-classes-class-InvalidPropNameError" class="menu-class">InvalidPropNameError</a></li><li><a href="#module-exceptions-classes-class-InvalidPropValueError" class="menu-class">InvalidPropValueError</a></li><li><a href="#module-exceptions-classes-class-InvalidPropChoiceError" class="menu-class">InvalidPropChoiceError</a></li><li><a href="#module-exceptions-classes-class-InvalidPropBoolError" class="menu-class">InvalidPropBoolError</a></li><li><a href="#module-exceptions-classes-class-RequiredPropError" class="menu-class">RequiredPropError</a></li><li><a href="#module-exceptions-classes-class-UnsetPropError" class="menu-class">UnsetPropError</a></li><li><a href="#module-exceptions-classes-class-InvalidChildrenError" class="menu-class">InvalidChildrenError</a></li><li><a href="#module-exceptions-classes-class-GeneralParserError" class="menu-class">GeneralParserError</a></li><li><a href="#module-exceptions-classes-class-BadCharError" class="menu-class">BadCharError</a></li><li><a href="#module-exceptions-classes-class-ParserError" class="menu-class">ParserError</a></li></ul></details></li></ul></details></li></ul></nav><main><h1 class="h"><a href="index.html" title="Back to documentation index">MIXT documentation</a>: API</h1><div class="doc"><details id="PropTypes" class="doc-part PropTypes manual" tabindex="-1"><summary><h2 class="h">PropTypes</h2><a class="permalink" href="#PropTypes" title="Permalink to here">¶</a></summary><div class="content"><p><strong>PropTypes are at the heart of Mixt. The aim si to specify precisely
what kind of data a component is allowed to receive.</strong></p><p>It is then "strongly typed" (sort of). And of course largely inspired by React.</p><p>It works by defining a class named <code>PropTypes</code> inside your components. (see full
example below).</p><p>Then, you must define the type
(using the <a href="https://docs.python.org/3.6/library/typing.html">python typing syntax</a>),
and, if you want, a default value. The format is <code>prop_name: type</code> or
<code>prop_name: type = default</code>.</p><details id="PropTypes-types" class="doc-part PropTypes-doc-part PropTypes-types" tabindex="-1" open><summary><h3 class="h">Special types</h3><a class="permalink" href="#PropTypes-types" title="Permalink to here">¶</a></summary><div class="content"><div id="PropTypes-types-Required" tabindex="0" class="doc-part value value-named"><h4 class="h">Required<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-types-Required" title="Permalink to here">¶</a><details open class="docstring"><summary><p>By default all props are optional. Enclosing a prop type with <code>Required[]</code> make it... required.</p></summary><p class="content">Note: A required prop cannot have a default value.</p></details><details id="PropTypes-types-Required-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-types-Required-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">Required</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">optional_prop</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">...</span> <span class="n">required_prop</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
</pre></div>
</details></div><div id="PropTypes-types-Choices" tabindex="0" class="doc-part value value-named"><h4 class="h">Choices<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-types-Choices" title="Permalink to here">¶</a><details open class="docstring"><summary><p><code>Choices</code> allows to define a list of acceptable value.</p></summary><p class="content">In the <code>PropTypes</code> class, <code>Choices</code> is used as the type. And the value of this prop is the list of choices.</p></details><details id="PropTypes-types-Choices-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-types-Choices-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">Choices</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">size</span><span class="p">:</span> <span class="n">Choices</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'XS'</span><span class="p">,</span> <span class="s1">'S'</span><span class="p">,</span> <span class="s1">'M'</span><span class="p">,</span> <span class="s1">'L'</span><span class="p">,</span> <span class="s1">'XL'</span><span class="p">,</span> <span class="s1">'XXL'</span><span class="p">]</span>
</pre></div>
</details></div><div id="PropTypes-types-DefaultChoices" tabindex="0" class="doc-part value value-named"><h4 class="h">DefaultChoices<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-types-DefaultChoices" title="Permalink to here">¶</a><div class="docstring"><p><code>DefaultChoices</code> is like <code>Choices</code> but the first entry will be the default prop value.</p></div><details id="PropTypes-types-DefaultChoices-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-types-DefaultChoices-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">DefaultChoices</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">size</span><span class="p">:</span> <span class="n">DefaultChoices</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'XS'</span><span class="p">,</span> <span class="s1">'S'</span><span class="p">,</span> <span class="s1">'M'</span><span class="p">,</span> <span class="s1">'L'</span><span class="p">,</span> <span class="s1">'XL'</span><span class="p">,</span> <span class="s1">'XXL'</span><span class="p">]</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="o">/>.</span><span class="n">size</span>
<span class="s1">'XS'</span>
</pre></div>
</details></div></div></details><details id="PropTypes-values" class="doc-part PropTypes-doc-part PropTypes-values" tabindex="-1" open><summary><h3 class="h">Special values</h3><a class="permalink" href="#PropTypes-values" title="Permalink to here">¶</a></summary><div class="content"><div id="PropTypes-values-Booleans" tabindex="0" class="doc-part value value-named"><h4 class="h">Booleans<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-values-Booleans" title="Permalink to here">¶</a><details open class="docstring"><summary><p>boolean props are handled specifically.</p></summary><div class="content"><p>A boolean can be passed:</p><ul><li><p>in python (<code><Comp flagged={False} /></code>, <code><Comp flagged={bool_value} /></code>)</p></li><li><p>as a string (<code><Comp flagged=false /></code>, <code><Comp flagged='false' /></code>)</p></li><li><p>without value (<code><Comp flagged /></code>): it is then <code>True</code></p></li><li><p>with a empty string (<code><Comp flagged='' /></code>): it is then <code>True</code></p></li><li><p>with the name of the prop as value (<code><Comp flagged='flagged' /></code>): it is then <code>True</code></p></li></ul><p>All other case are not valid.
Passing without attribute, or with empty string or name of the prop as value is inspired by HTML boolean attributes.</p></div></details><details id="PropTypes-values-Booleans-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-values-Booleans-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">flagged</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="n">true</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="s2">"true"</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="n">TRUE</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="p">{</span><span class="kc">True</span><span class="p">}</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="s2">""</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="s2">"flagged"</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="s2">"other"</span> <span class="o">/></span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropBoolError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">flagged</span><span class="p">:</span> <span class="err">`</span><span class="n">other</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span> <span class="n">valid</span> <span class="n">choice</span> <span class="k">for</span> <span class="n">this</span> <span class="n">boolean</span> <span class="n">prop</span> <span class="p">(</span><span class="n">must</span> <span class="n">be</span> <span class="ow">in</span> <span class="p">[</span><span class="kc">True</span><span class="p">,</span> <span class="kc">False</span><span class="p">,</span> <span class="s1">'true'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="s1">'flagged'</span><span class="p">])</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="n">false</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="s2">"false"</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="n">FALSE</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">flagged</span><span class="o">=</span><span class="p">{</span><span class="kc">False</span><span class="p">}</span> <span class="o">/>.</span><span class="n">flagged</span>
<span class="kc">False</span>
</pre></div>
</details></div><div id="PropTypes-values-Numbers" tabindex="0" class="doc-part value value-named"><h4 class="h">Numbers<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-values-Numbers" title="Permalink to here">¶</a><div class="docstring"><p>Numbers (<code>int</code> and <code>float</code>) can be passed as string, and numbers can be passed to strings.</p></div><details id="PropTypes-values-Numbers-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-values-Numbers-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="n">num</span><span class="p">:</span> <span class="nb">int</span>
<span class="n">string</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">num</span><span class="o">=</span><span class="mi">1</span> <span class="o">/>.</span><span class="n">num</span>
<span class="mi">1</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">num</span><span class="o">=</span><span class="s2">"1"</span> <span class="o">/>.</span><span class="n">num</span>
<span class="mi">1</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">num</span><span class="o">=</span><span class="p">{</span><span class="mi">1</span><span class="p">}</span> <span class="o">/>.</span><span class="n">num</span>
<span class="mi">1</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">num</span><span class="o">=</span><span class="p">{</span><span class="s2">"1"</span><span class="p">}</span> <span class="o">/></span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropValueError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">num</span><span class="p">:</span> <span class="err">`</span><span class="mi">1</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span> <span class="n">valid</span> <span class="n">value</span> <span class="k">for</span> <span class="n">this</span> <span class="n">prop</span> <span class="p">(</span><span class="nb">type</span><span class="p">:</span> <span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">str</span><span class="s1">'>, expected: <class '</span><span class="nb">int</span><span class="s1">'>)</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="mi">1</span> <span class="o">/>.</span><span class="n">string</span>
<span class="s1">'1'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="p">{</span><span class="mi">1</span><span class="p">}</span> <span class="o">/>.</span><span class="n">string</span>
<span class="s1">'1'</span>
</pre></div>
</details></div><div id="PropTypes-values-None" tabindex="0" class="doc-part value value-named"><h4 class="h">None<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-values-None" title="Permalink to here">¶</a><details open class="docstring"><summary><p><code>None</code> will be interpreted as python <code>None</code> if passed directly or as string.</p></summary><div class="content"><p>It is important to note the difference between <code>None</code> and <code>NotProvided</code>.</p><p><code>None</code> is actually a value, and cannot be passed to a prop not having <code>None</code> as possible type.</p></div></details><details id="PropTypes-values-None-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-values-None-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">string</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">...</span> <span class="n">string_or_none</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="nb">str</span><span class="p">]</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string_or_none</span><span class="o">=</span><span class="kc">None</span> <span class="o">/>.</span><span class="n">string_or_none</span>
<span class="kc">None</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string_or_none</span><span class="o">=</span><span class="s2">"None"</span> <span class="o">/>.</span><span class="n">string_or_none</span>
<span class="kc">None</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string_or_none</span><span class="o">=</span><span class="p">{</span><span class="s2">"None"</span><span class="p">}</span> <span class="o">/>.</span><span class="n">string_or_none</span>
<span class="s1">'None'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="kc">None</span> <span class="o">/>.</span><span class="n">string</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropValueError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">string</span><span class="p">:</span> <span class="err">`</span><span class="kc">None</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span> <span class="n">valid</span> <span class="n">value</span> <span class="k">for</span> <span class="n">this</span> <span class="n">prop</span> <span class="p">(</span><span class="nb">type</span><span class="p">:</span> <span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">NoneType</span><span class="s1">'>, expected: <class '</span><span class="nb">str</span><span class="s1">'>)</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="s2">"None"</span> <span class="o">/>.</span><span class="n">string</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropValueError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">string</span><span class="p">:</span> <span class="err">`</span><span class="kc">None</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span> <span class="n">valid</span> <span class="n">value</span> <span class="k">for</span> <span class="n">this</span> <span class="n">prop</span> <span class="p">(</span><span class="nb">type</span><span class="p">:</span> <span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">NoneType</span><span class="s1">'>, expected: <class '</span><span class="nb">str</span><span class="s1">'>)</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="s2">"None"</span> <span class="o">/>.</span><span class="n">string</span>
<span class="s1">'None'</span>
</pre></div>
</details></div><div id="PropTypes-values-NotProvided" tabindex="0" class="doc-part value value-named"><h4 class="h">NotProvided<span class="attr-details"></span></h4><a class="permalink" href="#PropTypes-values-NotProvided" title="Permalink to here">¶</a><div class="docstring"><p>Passing <code>NotProvided</code> (directly, in python or as a string) to a prop is equal to not pass it anything. The prop won't be set.</p></div><details id="PropTypes-values-NotProvided-example" class="doc-part value-doc-part value-example" tabindex="-1"><summary><h5 class="h">Example</h5><a class="permalink" href="#PropTypes-values-NotProvided-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">NotProvided</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">string</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="n">NotProvided</span> <span class="o">/>.</span><span class="n">string</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">string</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="p">{</span><span class="n">NotProvided</span><span class="p">}</span> <span class="o">/>.</span><span class="n">string</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">string</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="s2">"NotProvided"</span> <span class="o">/>.</span><span class="n">string</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">string</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">NotProvided</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="p">{</span><span class="n">value</span><span class="p">}</span> <span class="o">/>.</span><span class="n">string</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Component</span><span class="o">>.</span><span class="n">string</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="n">value</span> <span class="o">=</span> <span class="s2">"NotProvided"</span>
<span class="o"><</span><span class="n">Component</span> <span class="n">string</span><span class="o">=</span><span class="p">{</span><span class="n">value</span><span class="p">}</span> <span class="o">/>.</span><span class="n">string</span>
<span class="s1">'NotProvided'</span>
</pre></div>
</details></div></div></details></div></details><details id="class-Element" class="doc-part class" tabindex="-1"><summary><h2 class="h">Element</h2><a class="permalink" href="#class-Element" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Base element for reusable components.</p></div><details id="class-Element-prop_types" class="doc-part prop_types" tabindex="-1" open><summary><h3 class="h">PropTypes</h3><a class="permalink" href="#class-Element-prop_types" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Default props for all elements.</p></div><details id="class-Element-prop_types-props" class="doc-part prop_types-doc-part prop_types-props" tabindex="-1" open><summary><h4 class="h">Props</h4><a class="permalink" href="#class-Element-prop_types-props" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-prop_types-props-ref" tabindex="0" class="doc-part value value-named"><h5 class="h">ref<span class="attr-details">: <code>Ref</code></span></h5><a class="permalink" href="#class-Element-prop_types-props-ref" title="Permalink to here">¶</a><div class="docstring"><p>A reference to the element itself that can be used later. See <code>Ref</code> for more information.</p></div></div><div id="class-Element-prop_types-props-id" tabindex="0" class="doc-part value value-named"><h5 class="h">id<span class="attr-details">: <code>str</code></span></h5><a class="permalink" href="#class-Element-prop_types-props-id" title="Permalink to here">¶</a><div class="docstring"><p>The id of the element. It will not be passed down the tree like <code>_class</code>.</p></div></div><div id="class-Element-prop_types-props-_class" tabindex="0" class="doc-part value value-named"><h5 class="h">_class<span class="attr-details">: <code>str</code></span></h5><a class="permalink" href="#class-Element-prop_types-props-_class" title="Permalink to here">¶</a><div class="docstring"><p>A string containing the "class" html attribute that will be passed down to the first rendered html element.</p></div></div></div></details> <details id="class-Element-prop_types-example" class="doc-part prop_types-doc-part prop_types-example" tabindex="-1" open><summary><h4 class="h">Example</h4><a class="permalink" href="#class-Element-prop_types-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span> <span class="nb">id</span><span class="o">=</span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">}</span><span class="o">></span><span class="n">Hello</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Component</span> <span class="n">class</span><span class="o">=</span><span class="s2">"some class"</span> <span class="nb">id</span><span class="o">=</span><span class="s2">"FOO"</span> <span class="o">/></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span> <span class="nb">id</span><span class="o">=</span><span class="s2">"FOO"</span> <span class="n">class</span><span class="o">=</span><span class="s2">"some class"</span><span class="o">></span><span class="n">Hello</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</details></div></details><details id="class-Element-example" class="doc-part class-doc-part class-example" tabindex="-1" open><summary><h3 class="h">Example</h3><a class="permalink" href="#class-Element-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="c1"># In pure python:</span>
<span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">Element</span><span class="p">,</span> <span class="n">Required</span><span class="p">,</span> <span class="n">html</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="n">html</span><span class="o">.</span><span class="n">Div</span><span class="p">(</span>
<span class="o">...</span> <span class="s1">'Hello, '</span><span class="p">,</span>
<span class="o">...</span> <span class="n">html</span><span class="o">.</span><span class="n">Strong</span><span class="p">()(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="o">...</span> <span class="p">)</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s1">'World'</span> <span class="o">/></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">World</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># In "mixt", aka 'html in python":</span>
<span class="c1"># Notes: "html in python" does not work in a python shell, only in files.</span>
<span class="c1"># And you must import ``html`` from ``mixt`` to use normal html tags.</span>
<span class="o">>>></span> <span class="c1"># coding: mixt</span>
<span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">Element</span><span class="p">,</span> <span class="n">Required</span><span class="p">,</span> <span class="n">html</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">}</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s1">'World'</span> <span class="o">/></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">World</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># And to show how the ``__tag__`` and ``__display_name__`` attributes are composed by default:</span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">__tag__</span>
<span class="s1">'Greeting'</span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">__display_name__</span>
<span class="s1">'Greeting'</span>
</pre></div>
</details><details id="class-Element-attributes" class="doc-part class-doc-part class-attributes" tabindex="-1" open><summary><h3 class="h">Attributes</h3><a class="permalink" href="#class-Element-attributes" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-attributes-__tag__" tabindex="0" class="doc-part value value-named"><h4 class="h">__tag__<span class="attr-details">: <code>str</code> = <code>'Element'</code></span></h4><a class="permalink" href="#class-Element-attributes-__tag__" title="Permalink to here">¶</a><div class="docstring"><p>The tag to use when using the element in "html". If not set in the class, it will be, by default, the name of the class itself.</p></div></div><div id="class-Element-attributes-__display_name__" tabindex="0" class="doc-part value value-named"><h4 class="h">__display_name__<span class="attr-details">: <code>str</code> = <code>'Element'</code></span></h4><a class="permalink" href="#class-Element-attributes-__display_name__" title="Permalink to here">¶</a><div class="docstring"><p>A "human" representation of <code>__tag__</code>. Will be used in exceptions and can be changed to give more information.</p></div></div></div></details><details id="class-Element-methods" class="doc-part class-doc-part class-methods" tabindex="-1" open><summary><h3 class="h">Methods</h3><a class="permalink" href="#class-Element-methods" title="Permalink to here">¶</a></summary><div class="content"><details id="class-Element-methods-prop" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">prop(<span class="function-arg">name: <code>str</code>, </span><span class="function-arg">default: <code>Any</code> = <code>NotProvided</code></span>) → <code>Any</code></h4><a class="permalink" href="#class-Element-methods-prop" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return a prop defined by <code class="reference">name</code>, if it is defined, or the <code class="reference">default</code> if provided.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>If the prop exists but is not set, <code class="reference">default</code> is not provided, and the prop has a default value, this default value is returned.</p><p>Calling <code>el.prop("name")</code> is the same as calling <code>el.name</code>.</p></div> <details id="class-Element-methods-prop-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prop-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-prop-arguments-name" tabindex="0" class="doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-prop-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the wanted prop.</p></div></div><div id="class-Element-methods-prop-arguments-default" tabindex="0" class="doc-part value value-named"><h6 class="h">default<span class="attr-details">: <code>Any</code> = <code>'NotProvided'</code></span></h6><a class="permalink" href="#class-Element-methods-prop-arguments-default" title="Permalink to here">¶</a><div class="docstring"><p>The value to return if the prop is not set. If <code>NotProvided</code>, the default value set in PropTypes is used. Else we raise.</p></div></div></div></details> <details id="class-Element-methods-prop-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prop-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Any</code></h6><a class="permalink" href="#class-Element-methods-prop-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The value of the prop or a default one.</p></div></div></details> <details id="class-Element-methods-prop-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-prop-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-prop-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If the prop is not set and no default value is available.</p></div></div></details> <details id="class-Element-methods-prop-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prop-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="s1">'World'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">name</span>
<span class="s1">'World'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">surname</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">surname</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">surname</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">,</span> <span class="s2">"J"</span><span class="p">)</span>
<span class="s1">'J'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">surname</span><span class="o">=</span><span class="s2">"JJ"</span><span class="o">/>.</span><span class="n">prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="s1">'JJ'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">/>.</span><span class="n">prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="s1">'John'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">firstname</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prop_name" class="doc-part function function-classmethod" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@classmethod<br /></span>prop_name(<span class="function-arg">name: <code>str</code></span>) → <code>str</code></h4><a class="permalink" href="#class-Element-methods-prop_name" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return the corrected name for the prop defined by <code class="reference">name</code>, if the prop exists.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>For example, if <code class="reference">name</code> is "class", it will return "_class". If "data-foo", it will return "data_foo".</p></div> <details id="class-Element-methods-prop_name-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prop_name-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_name-arguments-name" tabindex="0" class="content doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-prop_name-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name we want to validate.</p></div></div></details> <details id="class-Element-methods-prop_name-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prop_name-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_name-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>str</code></h6><a class="permalink" href="#class-Element-methods-prop_name-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The real name of the given prop.</p></div></div></details> <details id="class-Element-methods-prop_name-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-prop_name-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_name-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-prop_name-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code>.</p></div></div></details> <details id="class-Element-methods-prop_name-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prop_name-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">some_name</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="n">Component</span><span class="o">.</span><span class="n">prop_name</span><span class="p">(</span><span class="s1">'some-name'</span><span class="p">)</span>
<span class="s1">'some_name'</span>
<span class="o">>>></span> <span class="n">Component</span><span class="o">.</span><span class="n">prop_name</span><span class="p">(</span><span class="s1">'class'</span><span class="p">)</span>
<span class="s1">'_class'</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-has_prop" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">has_prop(<span class="function-arg">name: <code>str</code>, </span><span class="function-arg">allow_invalid: <code>bool</code> = <code>True</code></span>) → <code>bool</code></h4><a class="permalink" href="#class-Element-methods-has_prop" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Tell if the prop defined by <code class="reference">name</code> is defined (or has a default value.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-has_prop-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-has_prop-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-has_prop-arguments-name" tabindex="0" class="doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-has_prop-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop to check.</p></div></div><div id="class-Element-methods-has_prop-arguments-allow_invalid" tabindex="0" class="doc-part value value-named"><h6 class="h">allow_invalid<span class="attr-details">: <code>bool</code> = <code>True</code></span></h6><a class="permalink" href="#class-Element-methods-has_prop-arguments-allow_invalid" title="Permalink to here">¶</a><div class="docstring"><p>If set to <code>True</code>, it will return <code>False</code> if the <code class="reference">name</code> if for a prop that is not allowed. Else if will raise <code>InvalidPropNameError</code>.</p></div></div></div></details> <details id="class-Element-methods-has_prop-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-has_prop-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-has_prop-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>bool</code></h6><a class="permalink" href="#class-Element-methods-has_prop-returns-0" title="Permalink to here">¶</a><div class="docstring"><p><code>True</code> if the prop is defined, <code>False</code> otherwise.</p></div></div></details> <details id="class-Element-methods-has_prop-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-has_prop-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-has_prop-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-has_prop-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code> and <code class="reference">allow_invalid</code> is False.</p></div></div></details> <details id="class-Element-methods-has_prop-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-has_prop-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">surname</span><span class="o">=</span><span class="s2">"J"</span><span class="o">/>.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">/>.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">,</span> <span class="n">allow_invalid</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="kc">False</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-set_prop" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">set_prop(<span class="function-arg">name: <code>str</code>, </span><span class="function-arg">value: <code>Any</code></span>) → <code>Any</code></h4><a class="permalink" href="#class-Element-methods-set_prop" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Set the <code class="reference">value</code> of the prop defined by <code class="reference">name</code>, if it is valid.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>The value is validated only if not in dev-mode. But still converted if needed, like for booleans. If <code class="reference">value</code> is <code>NotProvided</code>, the prop is unset.</p></div> <details id="class-Element-methods-set_prop-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-set_prop-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-set_prop-arguments-name" tabindex="0" class="doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-set_prop-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop to set.</p></div></div><div id="class-Element-methods-set_prop-arguments-value" tabindex="0" class="doc-part value value-named"><h6 class="h">value<span class="attr-details">: <code>Any</code></span></h6><a class="permalink" href="#class-Element-methods-set_prop-arguments-value" title="Permalink to here">¶</a><div class="docstring"><p>The value to set to the prop. If set to <code>NotProvided</code>, this will unset the actual set value for this prop.</p></div></div></div></details> <details id="class-Element-methods-set_prop-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-set_prop-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-set_prop-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Any</code></h6><a class="permalink" href="#class-Element-methods-set_prop-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>If <code class="reference">value</code> is not <code>NotProvided</code> returns the value that is really set. It may have been changed by the validation process. If <code class="reference">value</code> is <code>NotProvided</code>, returns the value that was stored in the prop before deleting it.</p></div></div></details> <details id="class-Element-methods-set_prop-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-set_prop-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-set_prop-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-set_prop-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If the value is not valid.</p></div></div></details> <details id="class-Element-methods-set_prop-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-set_prop-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"John"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">name</span>
<span class="s1">'John'</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="p">{</span><span class="s2">"first"</span><span class="p">:</span> <span class="s2">"John"</span><span class="p">})</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropValueError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">name</span><span class="p">:</span> <span class="err">`</span><span class="p">{</span><span class="s1">'first'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">}</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span>
<span class="n">valid</span> <span class="n">value</span> <span class="k">for</span> <span class="n">this</span> <span class="n">prop</span> <span class="p">(</span><span class="nb">type</span><span class="p">:</span> <span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">dict</span><span class="s1">'>, expected: <class '</span><span class="nb">str</span><span class="s1">'>)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_prop</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">,</span> <span class="s2">"John"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-unset_prop" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">unset_prop(<span class="function-arg">name: <code>str</code></span>) → <code>Any</code></h4><a class="permalink" href="#class-Element-methods-unset_prop" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Unset the actual value of the prop defined by <code class="reference">name</code>.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-unset_prop-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-unset_prop-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-unset_prop-arguments-name" tabindex="0" class="content doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-unset_prop-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop to unset.</p></div></div></details> <details id="class-Element-methods-unset_prop-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-unset_prop-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-unset_prop-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Any</code></h6><a class="permalink" href="#class-Element-methods-unset_prop-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The value that was stored in the prop before deleting it.</p></div></div></details> <details id="class-Element-methods-unset_prop-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-unset_prop-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-unset_prop-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-unset_prop-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code>.</p></div></div></details> <details id="class-Element-methods-unset_prop-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-unset_prop-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"John"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">name</span>
<span class="s1">'John'</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">unset_prop</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">name</span>
<span class="s1">'World'</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">,</span> <span class="s2">"JJ"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">surname</span>
<span class="s1">'JJ'</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">unset_prop</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">surnname</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">surname</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">unset_prop</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prop_default" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">prop_default(<span class="function-arg">name: <code>str</code></span>) → <code>Any</code></h4><a class="permalink" href="#class-Element-methods-prop_default" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return the default value of the prop defined by <code class="reference">name</code>.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-prop_default-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prop_default-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_default-arguments-name" tabindex="0" class="content doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-prop_default-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop for which we want the default value</p></div></div></details> <details id="class-Element-methods-prop_default-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prop_default-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_default-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Any</code></h6><a class="permalink" href="#class-Element-methods-prop_default-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The default value defined in <code>PropTypes</code> or <code>NotProvided</code> if not set.</p></div></div></details> <details id="class-Element-methods-prop_default-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-prop_default-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_default-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-prop_default-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code>.</p></div></div></details> <details id="class-Element-methods-prop_default-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prop_default-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="s1">'World'</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop_default</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">mixt</span><span class="o">.</span><span class="n">proptypes</span><span class="o">.</span><span class="n">NotProvided</span><span class="s1">'></span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">prop_default</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-is_prop_default" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">is_prop_default(<span class="function-arg">name: <code>str</code>, </span><span class="function-arg">value: <code>Any</code> = <code>NotProvided</code></span>) → <code>bool</code></h4><a class="permalink" href="#class-Element-methods-is_prop_default" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Tell if the actual (or given) value for the prop defined by <code class="reference">name</code> is the default one.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-is_prop_default-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-is_prop_default-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-is_prop_default-arguments-name" tabindex="0" class="doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-is_prop_default-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop we are asking for.</p></div></div><div id="class-Element-methods-is_prop_default-arguments-value" tabindex="0" class="doc-part value value-named"><h6 class="h">value<span class="attr-details">: <code>Any</code> = <code>'NotProvided'</code></span></h6><a class="permalink" href="#class-Element-methods-is_prop_default-arguments-value" title="Permalink to here">¶</a><div class="docstring"><p>If set, will use this value to check if it is the default one. Else (if <code>NotProvided</code>), it will use the actual prop.</p></div></div></div></details> <details id="class-Element-methods-is_prop_default-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-is_prop_default-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-is_prop_default-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>bool</code></h6><a class="permalink" href="#class-Element-methods-is_prop_default-returns-0" title="Permalink to here">¶</a><div class="docstring"><p><code>True</code> if the given value or the prop value is the default one, <code>False</code> otherwise.</p></div></div></details> <details id="class-Element-methods-is_prop_default-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-is_prop_default-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-is_prop_default-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-is_prop_default-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code>.</p></div></div></details> <details id="class-Element-methods-is_prop_default-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-is_prop_default-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"John"</span><span class="p">)</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"World"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"World"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"John"</span><span class="p">)</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">UnsetPropError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">surname</span><span class="p">:</span> <span class="n">prop</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">set</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">,</span> <span class="s2">"JJ"</span><span class="p">)</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">surname</span><span class="o">=</span><span class="s2">"JJ"</span> <span class="o">/>.</span><span class="n">is_prop_default</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="kc">False</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prop_type" class="doc-part function function-classmethod" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@classmethod<br /></span>prop_type(<span class="function-arg">name: <code>str</code></span>) → <code>Any</code></h4><a class="permalink" href="#class-Element-methods-prop_type" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return the type of the prop defined by <code class="reference">name</code>.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-prop_type-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prop_type-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_type-arguments-name" tabindex="0" class="content doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-prop_type-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop we want the type</p></div></div></details> <details id="class-Element-methods-prop_type-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prop_type-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_type-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Any</code></h6><a class="permalink" href="#class-Element-methods-prop_type-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The type, coming from <code>PropTypes</code></p></div></div></details> <details id="class-Element-methods-prop_type-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-prop_type-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prop_type-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-prop_type-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code>.</p></div></div></details> <details id="class-Element-methods-prop_type-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prop_type-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">prop_type</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">str</span><span class="s1">'></span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">prop_type</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">str</span><span class="s1">'></span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">prop_type</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-is_prop_required" class="doc-part function function-classmethod" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@classmethod<br /></span>is_prop_required(<span class="function-arg">name: <code>str</code></span>) → <code>bool</code></h4><a class="permalink" href="#class-Element-methods-is_prop_required" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Tell if the prop defined by <code class="reference">name</code> is a required one.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-is_prop_required-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-is_prop_required-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-is_prop_required-arguments-name" tabindex="0" class="content doc-part value value-named"><h6 class="h">name<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-is_prop_required-arguments-name" title="Permalink to here">¶</a><div class="docstring"><p>The name of the prop we want to know if it is required.</p></div></div></details> <details id="class-Element-methods-is_prop_required-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-is_prop_required-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-is_prop_required-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>bool</code></h6><a class="permalink" href="#class-Element-methods-is_prop_required-returns-0" title="Permalink to here">¶</a><div class="docstring"><p><code>True</code> if the prop is required, <code>False</code> otherwise.</p></div></div></details> <details id="class-Element-methods-is_prop_required-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-is_prop_required-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-is_prop_required-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-is_prop_required-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If there is no prop with the given <code class="reference">name</code>.</p></div></div></details> <details id="class-Element-methods-is_prop_required-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-is_prop_required-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">is_prop_required</span><span class="p">(</span><span class="s2">"name"</span><span class="p">)</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">is_prop_required</span><span class="p">(</span><span class="s2">"surname"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="n">Greeting</span><span class="o">.</span><span class="n">is_prop_required</span><span class="p">(</span><span class="s2">"firstname"</span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-set_props" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">set_props(<span class="function-arg">props: <code>Dict[str, Any]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-set_props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Set some props in addition/replacement to the already set ones.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-set_props-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-set_props-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-set_props-arguments-props" tabindex="0" class="content doc-part value value-named"><h6 class="h">props<span class="attr-details">: <code>Dict[str, Any]</code></span></h6><a class="permalink" href="#class-Element-methods-set_props-arguments-props" title="Permalink to here">¶</a><div class="docstring"><p>A dict with each prop to set. If a prop is already set, it will be replaced.</p></div></div></details> <details id="class-Element-methods-set_props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-set_props-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-set_props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-set_props-returns-0" title="Permalink to here">¶</a></div></details> <details id="class-Element-methods-set_props-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-set_props-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-set_props-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-set_props-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If a value is not valid (if dev-mode)</p></div></div></details> <details id="class-Element-methods-set_props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-set_props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_props</span><span class="p">({</span><span class="s2">"name"</span><span class="p">:</span> <span class="s2">"John"</span><span class="p">,</span> <span class="s2">"surname"</span><span class="p">:</span> <span class="s2">"JJ"</span><span class="p">})</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">name</span>
<span class="s1">'John'</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">surname</span>
<span class="s1">'JJ'</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_props</span><span class="p">({</span><span class="s2">"name"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"first"</span><span class="p">:</span> <span class="s2">"John"</span><span class="p">}})</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropValueError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">name</span><span class="p">:</span> <span class="err">`</span><span class="p">{</span><span class="s1">'first'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">}</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span>
<span class="n">valid</span> <span class="n">value</span> <span class="k">for</span> <span class="n">this</span> <span class="n">prop</span> <span class="p">(</span><span class="nb">type</span><span class="p">:</span> <span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">dict</span><span class="s1">'>, expected: <class '</span><span class="nb">str</span><span class="s1">'>)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">set_props</span><span class="p">({</span><span class="s2">"firstname"</span><span class="p">:</span> <span class="s2">"John"</span><span class="p">})</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropNameError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">firstname</span><span class="p">:</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">an</span> <span class="n">allowed</span> <span class="n">prop</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-props" class="doc-part function function-property" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>props → <code>Props</code></h4><a class="permalink" href="#class-Element-methods-props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get all the available and set props, including default ones.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-props-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Props</code></h6><a class="permalink" href="#class-Element-methods-props-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>A dict with each defined props. If a prop is not set but has a default value, this one is used.</p></div></div></details> <details id="class-Element-methods-props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">props</span><span class="p">)</span>
<span class="p">{</span><span class="s1">'name'</span><span class="p">:</span> <span class="s1">'World'</span><span class="p">}</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span> <span class="n">surname</span><span class="o">=</span><span class="s2">"JJ"</span><span class="o">/>.</span><span class="n">props</span><span class="p">)</span>
<span class="p">{</span><span class="s1">'name'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">,</span> <span class="s1">'surname'</span><span class="p">:</span> <span class="s1">'JJ'</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-props_for" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">props_for(<span class="function-arg">component: <code>Type[Base]</code></span>) → <code>Dict[str, Any]</code></h4><a class="permalink" href="#class-Element-methods-props_for" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the props defined for the given component.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>Used when using <code>ElementProxy</code> to get the props of the proxied and the base.</p></div> <details id="class-Element-methods-props_for-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-props_for-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-props_for-arguments-component" tabindex="0" class="content doc-part value value-named"><h6 class="h">component<span class="attr-details">: <code>Type[Base]</code></span></h6><a class="permalink" href="#class-Element-methods-props_for-arguments-component" title="Permalink to here">¶</a><div class="docstring"><p>The component for which we want to restrict the props</p></div></div></details> <details id="class-Element-methods-props_for-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-props_for-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-props_for-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Dict[str, Any]</code></h6><a class="permalink" href="#class-Element-methods-props_for-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The dict of properties limited to the one of the given component.</p></div></div></details> <details id="class-Element-methods-props_for-raises" class="doc-part function-doc-part function-raises" tabindex="-1" open><summary><h5 class="h">Raises</h5><a class="permalink" href="#class-Element-methods-props_for-raises" title="Permalink to here">¶</a></summary><div id="class-Element-methods-props_for-raises-" tabindex="0" class="content doc-part value value-named"><h6 class="h"><span class="attr-details"></span></h6><a class="permalink" href="#class-Element-methods-props_for-raises-" title="Permalink to here">¶</a><div class="docstring"><p>If the component is not an Element or an HtmlElement</p></div></div></details> <details id="class-Element-methods-props_for-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-props_for-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">ElementProxy</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">>>></span> <span class="n">ComponentForCanvas</span> <span class="o">=</span> <span class="n">Component</span><span class="o">.</span><span class="n">For</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Canvas</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span> <span class="o">=</span> <span class="n">ComponentForCanvas</span><span class="p">(</span><span class="n">val</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mi">300</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">'height'</span><span class="p">:</span> <span class="mi">300</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props_for</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Canvas</span><span class="p">)</span>
<span class="p">{</span><span class="s1">'height'</span><span class="p">:</span> <span class="mi">300</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props_for</span><span class="p">(</span><span class="n">Component</span><span class="p">)</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-declared_props" class="doc-part function function-property" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>declared_props → <code>Props</code></h4><a class="permalink" href="#class-Element-methods-declared_props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the props that are declared in <code>PropTypes</code> (no <code>data_*</code> and <code>aria_*</code>).</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-declared_props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-declared_props-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-declared_props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Props</code></h6><a class="permalink" href="#class-Element-methods-declared_props-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The props limited to the ones declared in <code>PropTypes</code>.</p></div></div></details> <details id="class-Element-methods-declared_props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-declared_props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">>>></span> <span class="n">obj</span> <span class="o">=</span> <span class="n">Component</span><span class="p">(</span><span class="n">val</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">data_foo</span><span class="o">=</span><span class="s2">"bar"</span><span class="p">,</span> <span class="n">aria_disabled</span><span class="o">=</span><span class="s2">"true"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">'data_foo'</span><span class="p">:</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'aria_disabled'</span><span class="p">:</span> <span class="s1">'true'</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">declared_props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-non_declared_props" class="doc-part function function-property" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>non_declared_props → <code>Props</code></h4><a class="permalink" href="#class-Element-methods-non_declared_props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the props that are not declared in <code>PropTypes</code> (only <code>data_*</code> or <code>aria_*</code>).</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-non_declared_props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-non_declared_props-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-non_declared_props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Props</code></h6><a class="permalink" href="#class-Element-methods-non_declared_props-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The props limited to the non declared ones.</p></div></div></details> <details id="class-Element-methods-non_declared_props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-non_declared_props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">...</span> <span class="n">data_val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">...</span> <span class="n">aria_val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">>>></span> <span class="n">obj</span> <span class="o">=</span> <span class="n">Component</span><span class="p">(</span><span class="n">val</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">data_val</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">data_foo</span><span class="o">=</span><span class="s2">"bar"</span><span class="p">,</span> <span class="n">aria_val</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">aria_disabled</span><span class="o">=</span><span class="s2">"true"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">'data_val'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'data_foo'</span><span class="p">:</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'aria_val'</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="s1">'aria_disabled'</span><span class="p">:</span> <span class="s1">'true'</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">non_declared_props</span>
<span class="p">{</span><span class="s1">'data_foo'</span><span class="p">:</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'aria_disabled'</span><span class="p">:</span> <span class="s1">'true'</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prefixed_props" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">prefixed_props(<span class="function-arg">prefix: <code>str</code></span>) → <code>Dict[str, Any]</code></h4><a class="permalink" href="#class-Element-methods-prefixed_props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the props matching the given <code class="reference">prefix</code>.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-prefixed_props-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prefixed_props-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prefixed_props-arguments-prefix" tabindex="0" class="content doc-part value value-named"><h6 class="h">prefix<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-prefixed_props-arguments-prefix" title="Permalink to here">¶</a><div class="docstring"><p>The prefix to match.</p></div></div></details> <details id="class-Element-methods-prefixed_props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prefixed_props-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prefixed_props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Dict[str, Any]</code></h6><a class="permalink" href="#class-Element-methods-prefixed_props-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The props limited to the ones starting with <code class="reference">prefix</code>.</p></div></div></details> <details id="class-Element-methods-prefixed_props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prefixed_props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Compoment</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">foo</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">...</span> <span class="n">val1</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">...</span> <span class="n">val2</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">>>></span> <span class="n">obj</span> <span class="o">=</span> <span class="n">Component</span><span class="p">(</span><span class="n">foo</span><span class="o">=</span><span class="s1">'bar'</span><span class="p">,</span> <span class="n">val1</span><span class="o">=</span><span class="mi">11</span><span class="p">,</span> <span class="n">val2</span><span class="o">=</span><span class="mi">22</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props</span>
<span class="p">{</span><span class="s1">'foo'</span><span class="p">:</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'val1'</span><span class="p">:</span> <span class="mi">11</span><span class="p">,</span> <span class="s1">'val2'</span><span class="p">:</span> <span class="mi">22</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">prefixed_props</span><span class="p">(</span><span class="s1">'val'</span><span class="p">)</span>
<span class="p">{</span><span class="s1">'val1'</span><span class="p">:</span> <span class="mi">11</span><span class="p">,</span> <span class="s1">'val2'</span><span class="p">:</span> <span class="mi">22</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-to_string" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">to_string() → <code>str</code></h4><a class="permalink" href="#class-Element-methods-to_string" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Convert the element into an html string.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-to_string-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-to_string-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-to_string-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>str</code></h6><a class="permalink" href="#class-Element-methods-to_string-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The html ready to be used.</p></div></div></details> <details id="class-Element-methods-to_string-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-to_string-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"World"</span>
<span class="o">...</span> <span class="n">surname</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">}</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Greeting</span> <span class="o">/>.</span><span class="n">to_string</span><span class="p">()</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">World</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># It's what is actually called when using ``str(...)``</span>
<span class="o">>>></span> <span class="nb">str</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="o">/></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">World</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-children" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">children(<span class="function-arg">selector: <code>Union[str, Type[Base], None]</code> = <code>None</code>, </span><span class="function-arg">exclude: <code>bool</code> = <code>False</code></span>) → <code>List[Union[Base, str, Callable]]</code></h4><a class="permalink" href="#class-Element-methods-children" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return the (direct) children, maybe filtered.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-children-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-children-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-children-arguments-selector" tabindex="0" class="doc-part value value-named"><h6 class="h">selector<span class="attr-details">: <code>Union[str, Type[Base], None]</code> = <code>None</code></span></h6><a class="permalink" href="#class-Element-methods-children-arguments-selector" title="Permalink to here">¶</a><details class="docstring"><summary><p>Empty by default. Used to filter the children.</p></summary><div class="content"><p>If it's a string to specify how to filter the children:</p><ul><li><p>If it starts with a dot <code>.</code>, we select children having this class.</p></li><li><p>If it starts with a sharp <code>#</code>, we select children having this id.</p></li><li><p>Else we select children having this tag name.</p></li></ul><p>If it's a class, only instances of this class (or subclass) are returned</p></div></details></div><div id="class-Element-methods-children-arguments-exclude" tabindex="0" class="doc-part value value-named"><h6 class="h">exclude<span class="attr-details">: <code>bool</code> = <code>False</code></span></h6><a class="permalink" href="#class-Element-methods-children-arguments-exclude" title="Permalink to here">¶</a><div class="docstring"><p><code>False</code> by default. If <code>True</code>, the result of the selection done by <code>selector</code> is reversed. Ie we select ALL BUT children having this class/id/tag.</p></div></div></div></details> <details id="class-Element-methods-children-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-children-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-children-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>List[Union[Base, str, Callable]]</code></h6><a class="permalink" href="#class-Element-methods-children-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>A List, maybe empty, of all the children, maybe filtered.</p></div></div></details> <details id="class-Element-methods-children-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-children-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Details</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="n">p_element</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">P</span><span class="p">)</span>
<span class="o">...</span> <span class="n">other_children</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">P</span><span class="p">,</span> <span class="n">exclude</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">details</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">summary</span><span class="o">></span><span class="p">{</span><span class="n">p_element</span><span class="p">}</span><span class="o"></</span><span class="n">summary</span><span class="o">></span>
<span class="o">...</span> <span class="p">{</span><span class="n">other_children</span><span class="p">}</span>
<span class="o">...</span> <span class="o"></</span><span class="n">details</span><span class="o">></span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-append" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">append(<span class="function-arg">child_or_children: <code>Union[Base, str, Callable, List[Union[Base, str, Callable]]]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-append" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Append some children to the current element.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>In the process, we propagate the actual context to the children.</p></div> <details id="class-Element-methods-append-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-append-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-append-arguments-child_or_children" tabindex="0" class="content doc-part value value-named"><h6 class="h">child_or_children<span class="attr-details">: <code>Union[Base, str, Callable, List[Union[Base, str, Callable]]]</code></span></h6><a class="permalink" href="#class-Element-methods-append-arguments-child_or_children" title="Permalink to here">¶</a><div class="docstring"><p>The child(ren) to add.</p></div></div></details> <details id="class-Element-methods-append-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-append-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-append-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-append-returns-0" title="Permalink to here">¶</a></div></details> <details id="class-Element-methods-append-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-append-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">AddNote</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">note</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">prerender</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="o"><</span><span class="n">aside</span> <span class="n">class</span><span class="o">=</span><span class="s2">"note"</span><span class="o">></span><span class="n">Note</span><span class="p">:</span> <span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">note</span><span class="p">}</span><span class="o"></</span><span class="n">aside</span><span class="o">></span><span class="p">)</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">div</span><span class="o">><</span><span class="n">AddNote</span> <span class="n">note</span><span class="o">=</span><span class="s2">"you're welcome"</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="n">John</span><span class="o"></</span><span class="n">p</span><span class="o">></</span><span class="n">AddNote</span><span class="o">></</span><span class="n">div</span><span class="o">></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="n">John</span><span class="o"></</span><span class="n">p</span><span class="o">><</span><span class="n">aside</span> <span class="n">class</span><span class="o">=</span><span class="s2">"note"</span><span class="o">></span><span class="n">Note</span><span class="p">:</span> <span class="n">you</span><span class="s1">'re welcome</aside></div></span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prepend" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">prepend(<span class="function-arg">child_or_children: <code>Union[Base, str, Callable, List[Union[Base, str, Callable]]]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-prepend" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Prepend some children to the current element.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>In the process, we propagate the actual context to the children.</p></div> <details id="class-Element-methods-prepend-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prepend-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prepend-arguments-child_or_children" tabindex="0" class="content doc-part value value-named"><h6 class="h">child_or_children<span class="attr-details">: <code>Union[Base, str, Callable, List[Union[Base, str, Callable]]]</code></span></h6><a class="permalink" href="#class-Element-methods-prepend-arguments-child_or_children" title="Permalink to here">¶</a><div class="docstring"><p>The child(ren) to add.</p></div></div></details> <details id="class-Element-methods-prepend-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prepend-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prepend-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-prepend-returns-0" title="Permalink to here">¶</a></div></details> <details id="class-Element-methods-prepend-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prepend-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Title</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">text</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span> <span class="n">level</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">prerender</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend</span><span class="p">(</span><span class="o"><</span><span class="n">h</span> <span class="n">level</span><span class="o">=</span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">level</span><span class="p">}</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">}</span><span class="o"></</span><span class="n">h</span><span class="o">></span><span class="p">)</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Title</span> <span class="n">text</span><span class="o">=</span><span class="s2">"Welcome"</span> <span class="n">level</span><span class="o">=</span><span class="mi">1</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="n">John</span><span class="o"></</span><span class="n">p</span><span class="o">></</span><span class="n">Title</span><span class="o">></span><span class="p">)</span>
<span class="o"><</span><span class="n">h1</span><span class="o">></span><span class="n">Welcome</span><span class="o"></</span><span class="n">h1</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="n">John</span><span class="o"></</span><span class="n">p</span><span class="o">></span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-remove" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">remove(<span class="function-arg">child_or_children: <code>Union[Base, str, Callable, List[Union[Base, str, Callable]]]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-remove" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Remove some children from the current element.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-remove-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-remove-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-remove-arguments-child_or_children" tabindex="0" class="content doc-part value value-named"><h6 class="h">child_or_children<span class="attr-details">: <code>Union[Base, str, Callable, List[Union[Base, str, Callable]]]</code></span></h6><a class="permalink" href="#class-Element-methods-remove-arguments-child_or_children" title="Permalink to here">¶</a><div class="docstring"><p>The child(ren) to remove.</p></div></div></details> <details id="class-Element-methods-remove-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-remove-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-remove-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-remove-returns-0" title="Permalink to here">¶</a></div></details> <details id="class-Element-methods-remove-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-remove-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">NoHr</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">prerender</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Hr</span><span class="p">))</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">NoHr</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">p</span><span class="o">><</span><span class="n">hr</span> <span class="o">/><</span><span class="n">p</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">p</span><span class="o">><</span><span class="n">hr</span> <span class="o">/><</span><span class="n">p</span><span class="o">></span><span class="n">Baz</span><span class="o"></</span><span class="n">p</span><span class="o">></</span><span class="n">NoHr</span><span class="o">></span><span class="p">)</span>
<span class="o"><</span><span class="n">p</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">p</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">p</span><span class="o">><</span><span class="n">p</span><span class="o">></span><span class="n">Baz</span><span class="o"></</span><span class="n">p</span><span class="o">></span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-add_class" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">add_class(<span class="function-arg">klass: <code>str</code>, </span><span class="function-arg">prepend: <code>bool</code> = <code>False</code></span>) → <code>str</code></h4><a class="permalink" href="#class-Element-methods-add_class" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Add the given class(es) (<code class="reference">klass</code>) to the actual list of classes.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-add_class-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-add_class-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-add_class-arguments-klass" tabindex="0" class="doc-part value value-named"><h6 class="h">klass<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-add_class-arguments-klass" title="Permalink to here">¶</a><div class="docstring"><p>The class to add. If contains spaces, it will be a list of classes.</p></div></div><div id="class-Element-methods-add_class-arguments-prepend" tabindex="0" class="doc-part value value-named"><h6 class="h">prepend<span class="attr-details">: <code>bool</code> = <code>False</code></span></h6><a class="permalink" href="#class-Element-methods-add_class-arguments-prepend" title="Permalink to here">¶</a><div class="docstring"><p>If <code>False</code> (the default), the new class(es) will be added at the end of the existing list. If <code>True</code>, it/they will be added at the beginning.</p></div></div></div></details> <details id="class-Element-methods-add_class-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-add_class-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-add_class-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>str</code></h6><a class="permalink" href="#class-Element-methods-add_class-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The new value of the <code>class</code> prop.</p></div></div></details> <details id="class-Element-methods-add_class-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-add_class-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">pass</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Component</span> <span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">add_class</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">add_class</span><span class="p">(</span><span class="s2">"bar baz"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'baz'</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">add_class</span><span class="p">(</span><span class="s2">"zab rab"</span><span class="p">,</span> <span class="n">prepend</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'zab'</span><span class="p">,</span> <span class="s1">'rab'</span><span class="p">,</span> <span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'baz'</span><span class="p">]</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-append_class" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">append_class(<span class="function-arg">klass: <code>str</code></span>) → <code>str</code></h4><a class="permalink" href="#class-Element-methods-append_class" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Add the given class(es) (<code class="reference">klass</code>) to the end of the actual list of classes.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-append_class-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-append_class-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-append_class-arguments-klass" tabindex="0" class="content doc-part value value-named"><h6 class="h">klass<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-append_class-arguments-klass" title="Permalink to here">¶</a><div class="docstring"><p>The class to add. If contains spaces, it will be a list of classes.</p></div></div></details> <details id="class-Element-methods-append_class-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-append_class-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-append_class-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>str</code></h6><a class="permalink" href="#class-Element-methods-append_class-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The new value of the <code>class</code> prop.</p></div></div></details> <details id="class-Element-methods-append_class-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-append_class-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">pass</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Component</span> <span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">append_class</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">append_class</span><span class="p">(</span><span class="s2">"bar baz"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'baz'</span><span class="p">]</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prepend_class" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">prepend_class(<span class="function-arg">klass: <code>str</code></span>) → <code>str</code></h4><a class="permalink" href="#class-Element-methods-prepend_class" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Add the given class(es) (<code class="reference">klass</code>) to the beginning of the actual list of classes.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-prepend_class-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prepend_class-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prepend_class-arguments-klass" tabindex="0" class="content doc-part value value-named"><h6 class="h">klass<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-prepend_class-arguments-klass" title="Permalink to here">¶</a><div class="docstring"><p>The class to add. If contains spaces, it will be a list of classes.</p></div></div></details> <details id="class-Element-methods-prepend_class-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prepend_class-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prepend_class-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>str</code></h6><a class="permalink" href="#class-Element-methods-prepend_class-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The new value of the <code>class</code> prop.</p></div></div></details> <details id="class-Element-methods-prepend_class-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prepend_class-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">pass</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Component</span> <span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">prepend_class</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">prepend_class</span><span class="p">(</span><span class="s2">"bar baz"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'baz'</span><span class="p">,</span> <span class="s1">'foo'</span><span class="p">]</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-remove_class" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">remove_class(<span class="function-arg">klass: <code>str</code></span>) → <code>str</code></h4><a class="permalink" href="#class-Element-methods-remove_class" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Remove the given class(es) (<code class="reference">klass</code>) from the actual list of classes.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-remove_class-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-remove_class-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-remove_class-arguments-klass" tabindex="0" class="content doc-part value value-named"><h6 class="h">klass<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-remove_class-arguments-klass" title="Permalink to here">¶</a><div class="docstring"><p>The class to remove. If contains spaces, it will be a list of classes.</p></div></div></details> <details id="class-Element-methods-remove_class-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-remove_class-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-remove_class-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>str</code></h6><a class="permalink" href="#class-Element-methods-remove_class-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The new value of the <code>class</code> prop.</p></div></div></details> <details id="class-Element-methods-remove_class-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-remove_class-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">pass</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Component</span> <span class="n">class</span><span class="o">=</span><span class="s2">"foo bar"</span><span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">remove_class</span><span class="p">(</span><span class="s2">"baz"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">remove_class</span><span class="p">(</span><span class="s2">"bar"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">remove_class</span><span class="p">(</span><span class="s2">"foo bar baz"</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">classes</span>
<span class="p">[]</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-has_class" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">has_class(<span class="function-arg">klass: <code>str</code></span>) → <code>bool</code></h4><a class="permalink" href="#class-Element-methods-has_class" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Tell if the given <code class="reference">class</code> is in the actual list of classes.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-has_class-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-has_class-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-has_class-arguments-klass" tabindex="0" class="content doc-part value value-named"><h6 class="h">klass<span class="attr-details">: <code>str</code></span></h6><a class="permalink" href="#class-Element-methods-has_class-arguments-klass" title="Permalink to here">¶</a><div class="docstring"><p>The class to check.</p></div></div></details> <details id="class-Element-methods-has_class-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-has_class-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-has_class-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>bool</code></h6><a class="permalink" href="#class-Element-methods-has_class-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The new value of the <code>class</code> prop.</p></div></div></details> <details id="class-Element-methods-has_class-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-has_class-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">pass</span>
<span class="o">>>></span> <span class="n">el</span> <span class="o">=</span> <span class="o"><</span><span class="n">Component</span> <span class="n">class</span><span class="o">=</span><span class="s2">"foo"</span><span class="o">/></span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">has_class</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="n">el</span><span class="o">.</span><span class="n">has_class</span><span class="p">(</span><span class="s2">"bar"</span><span class="p">)</span>
<span class="kc">True</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-classes" class="doc-part function function-property" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>classes → <code>List[str]</code></h4><a class="permalink" href="#class-Element-methods-classes" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return a list of the classes defined in the "class" prop, or an empty list if not set.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-classes-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-classes-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-classes-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>List[str]</code></h6><a class="permalink" href="#class-Element-methods-classes-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>List of all the classes defined in the "class" prop.</p></div></div></details> <details id="class-Element-methods-classes-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-classes-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">pass</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="o">/>.</span><span class="n">classes</span>
<span class="p">[]</span>
<span class="o">>>></span> <span class="o"><</span><span class="n">Component</span> <span class="n">class</span><span class="o">=</span><span class="s2">"foo bar"</span> <span class="o">/>.</span><span class="n">classes</span>
<span class="p">[</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">]</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-render" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">render(<span class="function-arg">context: <code>Union[BaseContext, None]</code></span>) → <code>Union[Base, str, Callable, List[Union[Base, str, Callable]], None]</code></h4><a class="permalink" href="#class-Element-methods-render" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return elements to be rendered as html.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>Returns only all children (<code>self.children()</code>) by default.</p><p>Must be implemented in subclasses to do something else.</p><p>Must return a component, a list of components, a fragment, or False/None. See example for more details.</p></div> <details id="class-Element-methods-render-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-render-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-render-arguments-context" tabindex="0" class="content doc-part value value-named"><h6 class="h">context<span class="attr-details">: <code>Union[BaseContext, None]</code></span></h6><a class="permalink" href="#class-Element-methods-render-arguments-context" title="Permalink to here">¶</a><div class="docstring"><p>The context passed through the tree.</p></div></div></details> <details id="class-Element-methods-render-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-render-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-render-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Union[Base, str, Callable, List[Union[Base, str, Callable]], None]</code></h6><a class="permalink" href="#class-Element-methods-render-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>None, or one or many elements or strings.</p></div></div></details> <details id="class-Element-methods-render-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-render-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="c1"># It can return a single element (a normal html tag or another component),</span>
<span class="c1"># which can have children:</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">}</span><span class="o"></</span><span class="n">strong</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">()}</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">></span><span class="p">,</span> <span class="n">you</span> <span class="n">look</span> <span class="n">great</span> <span class="n">today</span><span class="err">!</span><span class="o"></</span><span class="n">Greeting</span><span class="o">></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">John</span><span class="o"></</span><span class="n">strong</span><span class="o">></span><span class="p">,</span> <span class="n">you</span> <span class="n">look</span> <span class="n">great</span> <span class="n">today</span><span class="err">!</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># It can return many nodes, using ``<Fragment>``:</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">Fragment</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">Fragment</span><span class="o">></span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># It can return many nodes, using an iterable (note the commas after each entry). The</span>
<span class="c1"># main purpose is to be able to compose the list before calling ``return``:</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="p">[</span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="p">,</span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="p">,</span>
<span class="o">...</span> <span class="p">]</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># It can return a simple string:</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="s2">"Foo Bar"</span>
<span class="n">Foo</span> <span class="n">Bar</span>
<span class="c1"># And a list of strings:</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="p">[</span><span class="s2">"Foo"</span><span class="p">,</span> <span class="s2">"Bar"</span><span class="p">]</span>
<span class="n">FooBar</span>
<span class="c1"># ``False`` and ``None`` are ignored:</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="p">[</span>
<span class="o">...</span> <span class="kc">False</span><span class="p">,</span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="p">,</span>
<span class="o">...</span> <span class="kc">None</span><span class="p">,</span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="p">,</span>
<span class="o">...</span> <span class="p">]</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># All of these rules can be mized up.</span>
<span class="c1"># Note how lists can be used not only at the first level:</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="p">[</span>
<span class="o">...</span> <span class="kc">False</span><span class="p">,</span>
<span class="o">...</span> <span class="p">[</span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="p">,</span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="p">,</span>
<span class="o">...</span> <span class="p">],</span>
<span class="o">...</span> <span class="kc">None</span><span class="p">,</span>
<span class="o">...</span> <span class="s2">"Baz"</span>
<span class="o">...</span> <span class="p">]</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Bar</span><span class="o"></</span><span class="n">div</span><span class="o">></span><span class="n">Baz</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-prerender" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">prerender(<span class="function-arg">context: <code>Union[BaseContext, None]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-prerender" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Provide a hook to do things before the element is rendered.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>Default behavior is to do nothing.</p></div> <details id="class-Element-methods-prerender-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-prerender-arguments" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prerender-arguments-context" tabindex="0" class="content doc-part value value-named"><h6 class="h">context<span class="attr-details">: <code>Union[BaseContext, None]</code></span></h6><a class="permalink" href="#class-Element-methods-prerender-arguments-context" title="Permalink to here">¶</a><div class="docstring"><p>The context passed through the tree.</p></div></div></details> <details id="class-Element-methods-prerender-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-prerender-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-prerender-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-prerender-returns-0" title="Permalink to here">¶</a></div></details> <details id="class-Element-methods-prerender-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-prerender-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">prerender</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">started_at</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">utcnow</span><span class="p">()</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Rendering <</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">__display_name__</span><span class="si">}</span><span class="s2">>..."</span><span class="p">)</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">postrender</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">element</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="n">duration</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">utcnow</span><span class="p">()</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">started_at</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Rendered <</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">__display_name__</span><span class="si">}</span><span class="s2">> in </span><span class="si">{</span><span class="n">duration</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-postrender" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">postrender(<span class="function-arg">element: <code>Union[Base, str, Callable]</code>, </span><span class="function-arg">context: <code>Union[BaseContext, None]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-postrender" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Provide a hook to do things after the element is rendered.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>Default behavior is to do nothing. See <code>prerender</code> for an example.</p></div> <details id="class-Element-methods-postrender-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-postrender-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-postrender-arguments-element" tabindex="0" class="doc-part value value-named"><h6 class="h">element<span class="attr-details">: <code>Union[Base, str, Callable]</code></span></h6><a class="permalink" href="#class-Element-methods-postrender-arguments-element" title="Permalink to here">¶</a><div class="docstring"><p>The element rendered by <code>render</code>. Could be an Element, an html tag, a RawHtml...</p></div></div><div id="class-Element-methods-postrender-arguments-context" tabindex="0" class="doc-part value value-named"><h6 class="h">context<span class="attr-details">: <code>Union[BaseContext, None]</code></span></h6><a class="permalink" href="#class-Element-methods-postrender-arguments-context" title="Permalink to here">¶</a><div class="docstring"><p>The context passed through the tree.</p></div></div></div></details> <details id="class-Element-methods-postrender-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-postrender-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-postrender-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-postrender-returns-0" title="Permalink to here">¶</a></div></details> </div></details></div></details><details id="class-Element-methods-postrender_child_element" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">postrender_child_element(<span class="function-arg">child: <code>Element</code>, </span><span class="function-arg">child_element: <code>Union[Base, str, Callable]</code>, </span><span class="function-arg">context: <code>Union[BaseContext, None]</code></span>) → <code>None</code></h4><a class="permalink" href="#class-Element-methods-postrender_child_element" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Provide a hook for every parent to do things after any child is rendered.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"><div class="docstring"><p>Default behavior is to do nothing. Useful to collect stuff for delayed rendering (see <code>CSSCollector</code> and <code>JSCollector</code>), stats...</p></div> <details id="class-Element-methods-postrender_child_element-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-Element-methods-postrender_child_element-arguments" title="Permalink to here">¶</a></summary><div class="content"><div id="class-Element-methods-postrender_child_element-arguments-child" tabindex="0" class="doc-part value value-named"><h6 class="h">child<span class="attr-details">: <code>Element</code></span></h6><a class="permalink" href="#class-Element-methods-postrender_child_element-arguments-child" title="Permalink to here">¶</a><div class="docstring"><p>The element in a tree on which <code>render</code> was just called.</p></div></div><div id="class-Element-methods-postrender_child_element-arguments-child_element" tabindex="0" class="doc-part value value-named"><h6 class="h">child_element<span class="attr-details">: <code>Union[Base, str, Callable]</code></span></h6><a class="permalink" href="#class-Element-methods-postrender_child_element-arguments-child_element" title="Permalink to here">¶</a><div class="docstring"><p>The element rendered by the call of the <code>render</code> method of <code class="reference">child</code>.</p></div></div><div id="class-Element-methods-postrender_child_element-arguments-context" tabindex="0" class="doc-part value value-named"><h6 class="h">context<span class="attr-details">: <code>Union[BaseContext, None]</code></span></h6><a class="permalink" href="#class-Element-methods-postrender_child_element-arguments-context" title="Permalink to here">¶</a><div class="docstring"><p>The context passed through the tree.</p></div></div></div></details> <details id="class-Element-methods-postrender_child_element-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-postrender_child_element-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-postrender_child_element-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#class-Element-methods-postrender_child_element-returns-0" title="Permalink to here">¶</a></div></details> <details id="class-Element-methods-postrender_child_element-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-postrender_child_element-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">ComponentCounter</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">int</span><span class="p">)</span>
<span class="o">...</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">postrender_child_element</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">child</span><span class="p">,</span> <span class="n">child_element</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span><span class="p">[</span><span class="n">child</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="o">>>></span> <span class="n">counter</span> <span class="o">=</span> <span class="n">Ref</span><span class="p">()</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span>
<span class="o">...</span> <span class="o"><</span><span class="n">ComponentCounter</span> <span class="n">ref</span><span class="o">=</span><span class="p">{</span><span class="n">counter</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="n">Rendered</span><span class="p">:</span>
<span class="o">...</span> <span class="p">{</span><span class="k">lambda</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="nb">dict</span><span class="p">(</span><span class="n">counter</span><span class="o">.</span><span class="n">current</span><span class="o">.</span><span class="n">count</span><span class="p">))}</span>
<span class="o">...</span> <span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s1">'World'</span><span class="o">/></span>
<span class="o">...</span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s1">'John'</span><span class="o">/></span>
<span class="o">...</span> <span class="o"></</span><span class="n">ComponentCounter</span><span class="o">></span>
<span class="o">...</span> <span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Rendered</span><span class="p">:</span> <span class="p">{</span><span class="s1">'Greeting'</span><span class="p">:</span> <span class="mi">2</span><span class="p">}</span><span class="o"></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">World</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span>
<span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">John</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</details></div></details></div></details><details id="class-Element-methods-add_ref" class="doc-part function function-method" tabindex="-1" open><summary><h4 class="h">add_ref() → <code>Ref</code></h4><a class="permalink" href="#class-Element-methods-add_ref" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Create and return a new <code>Ref</code> object.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Element-methods-add_ref-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Element-methods-add_ref-returns" title="Permalink to here">¶</a></summary><div id="class-Element-methods-add_ref-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Ref</code></h6><a class="permalink" href="#class-Element-methods-add_ref-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The ref, without value, ready to be set.</p></div></div></details> <details id="class-Element-methods-add_ref-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-Element-methods-add_ref-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="c1"># This:</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="n">some_ref</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_ref</span><span class="p">()</span>
<span class="c1"># Is exactly the same as:</span>
<span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">Ref</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="n">some_ref</span> <span class="o">=</span> <span class="n">Ref</span><span class="p">()</span>
<span class="c1"># It will simply avoid an import.</span>
<span class="c1"># See ``Ref`` documentation to know more about refs.</span>
</pre></div>
</details></div></details></div></details></div></details></div></details><details id="class-ElementProxy" class="doc-part class" tabindex="-1"><summary><h2 class="h">ElementProxy</h2><a class="permalink" href="#class-ElementProxy" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>A subclass of <code>Element</code> that is a proxy to another.</p></div><details id="class-ElementProxy-prop_types" class="doc-part prop_types" tabindex="-1" open><summary><h3 class="h">PropTypes</h3><a class="permalink" href="#class-ElementProxy-prop_types" title="Permalink to here">¶</a></summary><div class="content"><div class="prop_types-props"><div id="class-ElementProxy-prop_types-props-ref" tabindex="0" class="doc-part value value-named"><h4 class="h">ref<span class="attr-details">: <code>Ref</code></span></h4><a class="permalink" href="#class-ElementProxy-prop_types-props-ref" title="Permalink to here">¶</a><div class="docstring"><p>A reference to the element itself that can be used later. See <code>Ref</code> for more information.</p></div></div><div id="class-ElementProxy-prop_types-props-id" tabindex="0" class="doc-part value value-named"><h4 class="h">id<span class="attr-details">: <code>str</code></span></h4><a class="permalink" href="#class-ElementProxy-prop_types-props-id" title="Permalink to here">¶</a><div class="docstring"><p>The id of the element. It will not be passed down the tree like <code>_class</code>.</p></div></div><div id="class-ElementProxy-prop_types-props-_class" tabindex="0" class="doc-part value value-named"><h4 class="h">_class<span class="attr-details">: <code>str</code></span></h4><a class="permalink" href="#class-ElementProxy-prop_types-props-_class" title="Permalink to here">¶</a><div class="docstring"><p>A string containing the "class" html attribute that will be passed down to the first rendered html element.</p></div></div></div> </div></details><details id="class-ElementProxy-example" class="doc-part class-doc-part class-example" tabindex="-1" open><summary><h3 class="h">Example</h3><a class="permalink" href="#class-ElementProxy-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="c1"># You can define a proxy for an html element. Using `ElementProxy.For` allows to have</span>
<span class="c1"># a default proxied element. Without `.For`, the new proxy will need to be called later</span>
<span class="c1"># with `.For`.</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Button</span><span class="p">(</span><span class="n">ElementProxy</span><span class="o">.</span><span class="n">For</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Button</span><span class="p">)):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">label</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">'button'</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="c1"># we pass the the proxied element its own props</span>
<span class="o">...</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">proxied</span><span class="p">(</span><span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">proxied_props</span><span class="p">)(</span>
<span class="o">...</span> <span class="n">html</span><span class="o">.</span><span class="n">Span</span><span class="p">()(</span><span class="bp">self</span><span class="o">.</span><span class="n">label</span><span class="p">)</span>
<span class="o">...</span> <span class="p">)</span>
<span class="c1"># The "props" value is for the button element.</span>
<span class="o">>>></span> <span class="nb">str</span><span class="p">(</span><span class="n">Button</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="mi">1</span><span class="p">))</span> <span class="o">==</span> <span class="s1">'<button value="1"><span>button</span></button>'</span>
<span class="c1"># To change the proxied element, use `For`:</span>
<span class="o">>>></span> <span class="nb">str</span><span class="p">(</span><span class="n">Button</span><span class="o">.</span><span class="n">For</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Div</span><span class="p">)(</span><span class="s2">"ok"</span><span class="p">))</span> <span class="o">==</span> <span class="s1">'<div><span>ok</span></div>'</span>
</pre></div>
</details><details id="class-ElementProxy-attributes" class="doc-part class-doc-part class-attributes" tabindex="-1" open><summary><h3 class="h">Attributes</h3><a class="permalink" href="#class-ElementProxy-attributes" title="Permalink to here">¶</a></summary><div id="class-ElementProxy-attributes-proxied" tabindex="0" class="content doc-part value value-named"><h4 class="h">proxied<span class="attr-details">: <code>Type[Base]</code> = <code>None</code></span></h4><a class="permalink" href="#class-ElementProxy-attributes-proxied" title="Permalink to here">¶</a><div class="docstring"><p>The proxied component to be used in <code>render</code>. It's the one passed to the <code>For</code> method.</p></div></div></details><details id="class-ElementProxy-methods" class="doc-part class-doc-part class-methods" tabindex="-1" open><summary><h3 class="h">Methods</h3><a class="permalink" href="#class-ElementProxy-methods" title="Permalink to here">¶</a></summary><div class="content"><details id="class-ElementProxy-methods-For" class="doc-part function function-classmethod" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@classmethod<br /></span>For(<span class="function-arg">component: <code>Type[Base]</code></span>) → <code>Type[ElementProxy]</code></h4><a class="permalink" href="#class-ElementProxy-methods-For" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return a new version of this proxy, for the given element to proxy.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-ElementProxy-methods-For-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#class-ElementProxy-methods-For-arguments" title="Permalink to here">¶</a></summary><div id="class-ElementProxy-methods-For-arguments-component" tabindex="0" class="content doc-part value value-named"><h6 class="h">component<span class="attr-details">: <code>Type[Base]</code></span></h6><a class="permalink" href="#class-ElementProxy-methods-For-arguments-component" title="Permalink to here">¶</a><div class="docstring"><p>The element be be proxied</p></div></div></details> <details id="class-ElementProxy-methods-For-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-ElementProxy-methods-For-returns" title="Permalink to here">¶</a></summary><div id="class-ElementProxy-methods-For-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Type[ElementProxy]</code></h6><a class="permalink" href="#class-ElementProxy-methods-For-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>A new version of this proxy</p></div></div></details> </div></details></div></details><details id="class-ElementProxy-methods-proxied_props" class="doc-part function function-property" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>proxied_props → <code>Props</code></h4><a class="permalink" href="#class-ElementProxy-methods-proxied_props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the props for the proxied element (with <code>data_*</code> and <code>aria_*</code>).</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-ElementProxy-methods-proxied_props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-ElementProxy-methods-proxied_props-returns" title="Permalink to here">¶</a></summary><div id="class-ElementProxy-methods-proxied_props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Props</code></h6><a class="permalink" href="#class-ElementProxy-methods-proxied_props-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The props limited to the ones for the proxied element and non declared ones.</p></div></div></details> <details id="class-ElementProxy-methods-proxied_props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-ElementProxy-methods-proxied_props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">ElementProxy</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">>>></span> <span class="n">ComponentForCanvas</span> <span class="o">=</span> <span class="n">Component</span><span class="o">.</span><span class="n">For</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Canvas</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span> <span class="o">=</span> <span class="n">ComponentForCanvas</span><span class="p">(</span><span class="n">val</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span> <span class="n">data_foo</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">'height'</span><span class="p">:</span> <span class="mi">300</span><span class="p">,</span> <span class="s1">'data_foo'</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">proxied_props</span>
<span class="p">{</span><span class="s1">'height'</span><span class="p">:</span> <span class="mi">300</span><span class="p">,</span> <span class="n">data_foo</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details><details id="class-ElementProxy-methods-own_props" class="doc-part function function-property" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>own_props → <code>Props</code></h4><a class="permalink" href="#class-ElementProxy-methods-own_props" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the props for the base proxy element (no <code>data_*</code> and <code>aria_*</code>).</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-ElementProxy-methods-own_props-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-ElementProxy-methods-own_props-returns" title="Permalink to here">¶</a></summary><div id="class-ElementProxy-methods-own_props-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Props</code></h6><a class="permalink" href="#class-ElementProxy-methods-own_props-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The props limited to the ones for the base proxy element.</p></div></div></details> <details id="class-ElementProxy-methods-own_props-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#class-ElementProxy-methods-own_props-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">ElementProxy</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span>
<span class="o">>>></span> <span class="n">ComponentForCanvas</span> <span class="o">=</span> <span class="n">Component</span><span class="o">.</span><span class="n">For</span><span class="p">(</span><span class="n">html</span><span class="o">.</span><span class="n">Canvas</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span> <span class="o">=</span> <span class="n">ComponentForCanvas</span><span class="p">(</span><span class="n">val</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span> <span class="n">data_foo</span><span class="p">:</span> <span class="mi">1</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">'height'</span><span class="p">:</span> <span class="mi">300</span><span class="p">,</span> <span class="n">data_foo</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
<span class="o">>>></span> <span class="n">obj</span><span class="o">.</span><span class="n">own_props</span>
<span class="p">{</span><span class="s1">'val'</span><span class="p">:</span> <span class="mi">3</span><span class="p">}</span>
</pre></div>
</details></div></details></div></details></div></details></div></details><details id="class-Ref" class="doc-part class" tabindex="-1"><summary><h2 class="h">Ref</h2><a class="permalink" href="#class-Ref" title="Permalink to here">¶</a></summary><div class="content"><details open class="docstring"><summary><p>An object storing the reference to an element.</p></summary><p class="content">The goal is to use it later, once the element is rendered. For example by "collectors", like the first example below (or <code>CSSCollector</code> and <code>JSCollector</code>).</p></details><details id="class-Ref-example" class="doc-part class-doc-part class-example" tabindex="-1" open><summary><h3 class="h">Example</h3><a class="permalink" href="#class-Ref-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">ComponentCounter</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">int</span><span class="p">)</span>
<span class="o">...</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">postrender_child_element</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">child</span><span class="p">,</span> <span class="n">child_element</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span><span class="p">[</span><span class="n">child</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="o">>>></span> <span class="n">counter</span> <span class="o">=</span> <span class="n">Ref</span><span class="p">()</span>
<span class="c1"># Here we use the ref to display data from the referenced component, once it is rendered.</span>
<span class="c1"># Without this, it would not be possible. Also note the ``lambda``: this is mandatory</span>
<span class="c1"># because without it, we would not have the finalized data.</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span>
<span class="o">...</span> <span class="o"><</span><span class="n">ComponentCounter</span> <span class="n">ref</span><span class="o">=</span><span class="p">{</span><span class="n">counter</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="n">Rendered</span><span class="p">:</span>
<span class="o">...</span> <span class="p">{</span><span class="k">lambda</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="nb">dict</span><span class="p">(</span><span class="n">counter</span><span class="o">.</span><span class="n">current</span><span class="o">.</span><span class="n">count</span><span class="p">))}</span>
<span class="o">...</span> <span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s1">'World'</span><span class="o">/></span>
<span class="o">...</span> <span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s1">'John'</span><span class="o">/></span>
<span class="o">...</span> <span class="o"></</span><span class="n">ComponentCounter</span><span class="o">></span>
<span class="o">...</span> <span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Rendered</span><span class="p">:</span> <span class="p">{</span><span class="s1">'Greeting'</span><span class="p">:</span> <span class="mi">2</span><span class="p">}</span><span class="o"></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">World</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span>
<span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="n">John</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="c1"># Another example, using a ref inside the ``render`` method to, for example,</span>
<span class="c1"># access it in ``postrender``.</span>
<span class="c1"># Using ``ref = self.add_ref()`` in an element is the same as using ``ref = Ref()``.</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">strong_ref</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_ref</span><span class="p">()</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span> <span class="n">ref</span><span class="o">=</span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">strong_ref</span><span class="p">}</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">}</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">postrender</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">element</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="bp">self</span><span class="o">.</span><span class="n">strong_ref</span><span class="o">.</span><span class="n">current</span><span class="o">.</span><span class="n">add_class</span><span class="p">(</span><span class="s1">'very-strong'</span><span class="p">)</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="s2">"John"</span><span class="o">></</span><span class="n">Greeting</span><span class="o">></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span> <span class="n">class</span><span class="o">=</span><span class="s2">"very-strong"</span><span class="o">></span><span class="n">John</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</details><details id="class-Ref-methods" class="doc-part class-doc-part class-methods" tabindex="-1" open><summary><h3 class="h">Methods</h3><a class="permalink" href="#class-Ref-methods" title="Permalink to here">¶</a></summary><details id="class-Ref-methods-current" class="doc-part function function-property content" tabindex="-1" open><summary><h4 class="h"><span class="function-kind">@property<br /></span>current → <code>Optional[Base]</code></h4><a class="permalink" href="#class-Ref-methods-current" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Get the actual value of this ref.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="class-Ref-methods-current-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#class-Ref-methods-current-returns" title="Permalink to here">¶</a></summary><div id="class-Ref-methods-current-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Optional[Base]</code></h6><a class="permalink" href="#class-Ref-methods-current-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>If the ref was set, return the saved value, else <code>None</code>.</p></div></div></details> </div></details></div></details></details></div></details><details id="module-dev_mode" class="doc-part module" tabindex="-1"><summary><h2 class="h">dev_mode</h2><a class="permalink" href="#module-dev_mode" title="Permalink to here">¶</a></summary><div class="content"><details open class="docstring"><summary><p>Functions to get/activate/deactivate dev-mode.</p></summary><div class="content"><p>In "dev-mode", active by default, a lots of costly checks will be done when trying to set the props of elements to ensure that the types match the ones defined in <code>PropTypes</code>.</p><p>It's active by default to let you be sure that your code is correct.</p><p>Your tests must run in "dev-mode".</p><p>But in production, you trust your tests, and don't need to enforce type checking of your props.</p><p>And as "costly" means "time" or "money", you are encouraged to deactivate the "dev-mode" in production.</p><p>The included functions can be imported from <code>mixt.dev_mode</code> or, by convenience, from <code>mixt</code>.</p></div></details><details id="module-dev_mode-example" class="doc-part module-doc-part module-example" tabindex="-1" open><summary><h3 class="h">Example</h3><a class="permalink" href="#module-dev_mode-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="c1"># This example shows how in non-dev mode, props are not validated.</span>
<span class="c1"># This should of course be covered by tests so this cannot happen.</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">Greeting</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">name</span><span class="p">:</span> <span class="n">Required</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">}</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="n">in_dev_mode</span><span class="p">())</span> <span class="c1"># dev-mode is on by default</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="n">wrong_data</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"firstname"</span><span class="p">:</span> <span class="s2">"John"</span><span class="p">}</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="p">{</span><span class="n">wrong_data</span><span class="p">}</span> <span class="o">/></span><span class="p">)</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="o">...</span>
<span class="n">mixt</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">InvalidPropValueError</span><span class="p">:</span> <span class="o"><</span><span class="n">Greeting</span><span class="o">>.</span><span class="n">name</span><span class="p">:</span> <span class="err">`</span><span class="p">{</span><span class="s1">'firstname'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">}</span><span class="err">`</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">a</span> <span class="n">valid</span>
<span class="n">value</span> <span class="k">for</span> <span class="n">this</span> <span class="n">prop</span> <span class="p">(</span><span class="nb">type</span><span class="p">:</span> <span class="o"><</span><span class="k">class</span> <span class="err">'</span><span class="nc">dict</span><span class="s1">'>, expected: <class '</span><span class="nb">str</span><span class="s1">'>)</span>
<span class="o">>>></span> <span class="k">with</span> <span class="n">override_dev_mode</span><span class="p">(</span><span class="kc">False</span><span class="p">):</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="n">in_dev_mode</span><span class="p">())</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">Greeting</span> <span class="n">name</span><span class="o">=</span><span class="p">{</span><span class="n">wrong_data</span><span class="p">}</span> <span class="o">/></span><span class="p">)</span>
<span class="kc">False</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="p">,</span> <span class="o"><</span><span class="n">strong</span><span class="o">></span><span class="p">{</span><span class="s1">'firstname'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">}</span><span class="o"></</span><span class="n">strong</span><span class="o">></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</details><details id="module-dev_mode-functions" class="doc-part module-doc-part module-functions" tabindex="-1" open><summary><h3 class="h">Functions</h3><a class="permalink" href="#module-dev_mode-functions" title="Permalink to here">¶</a></summary><div class="content"><details id="module-dev_mode-functions-set_dev_mode" class="doc-part function function-function" tabindex="-1" open><summary><h4 class="h">set_dev_mode(<span class="function-arg">dev_mode: <code>bool</code> = <code>True</code></span>) → <code>None</code></h4><a class="permalink" href="#module-dev_mode-functions-set_dev_mode" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Change the dev-mode. Activate it if <code class="reference">dev_mode</code> is not defined.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="module-dev_mode-functions-set_dev_mode-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#module-dev_mode-functions-set_dev_mode-arguments" title="Permalink to here">¶</a></summary><div id="module-dev_mode-functions-set_dev_mode-arguments-dev_mode" tabindex="0" class="content doc-part value value-named"><h6 class="h">dev_mode<span class="attr-details">: <code>bool</code> = <code>True</code></span></h6><a class="permalink" href="#module-dev_mode-functions-set_dev_mode-arguments-dev_mode" title="Permalink to here">¶</a><div class="docstring"><p>The new dev mode wanted. Default to <code>True</code>. Will be casted to <code>bool</code>.</p></div></div></details> <details id="module-dev_mode-functions-set_dev_mode-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#module-dev_mode-functions-set_dev_mode-returns" title="Permalink to here">¶</a></summary><div id="module-dev_mode-functions-set_dev_mode-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#module-dev_mode-functions-set_dev_mode-returns-0" title="Permalink to here">¶</a></div></details> <details id="module-dev_mode-functions-set_dev_mode-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#module-dev_mode-functions-set_dev_mode-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">set_dev_mode</span><span class="p">,</span> <span class="n">in_dev_mode</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="n">set_dev_mode</span><span class="p">(</span><span class="kc">False</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="n">set_dev_mode</span><span class="p">()</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">True</span>
</pre></div>
</details></div></details></div></details><details id="module-dev_mode-functions-unset_dev_mode" class="doc-part function function-function" tabindex="-1" open><summary><h4 class="h">unset_dev_mode() → <code>None</code></h4><a class="permalink" href="#module-dev_mode-functions-unset_dev_mode" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Deactivate the dev-mode.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="module-dev_mode-functions-unset_dev_mode-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#module-dev_mode-functions-unset_dev_mode-returns" title="Permalink to here">¶</a></summary><div id="module-dev_mode-functions-unset_dev_mode-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>None</code></h6><a class="permalink" href="#module-dev_mode-functions-unset_dev_mode-returns-0" title="Permalink to here">¶</a></div></details> <details id="module-dev_mode-functions-unset_dev_mode-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#module-dev_mode-functions-unset_dev_mode-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">unset_dev_mode</span><span class="p">,</span> <span class="n">in_dev_mode</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="n">unset_dev_mode</span><span class="p">()</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">False</span>
</pre></div>
</details></div></details></div></details><details id="module-dev_mode-functions-override_dev_mode" class="doc-part function function-function" tabindex="-1" open><summary><h4 class="h">override_dev_mode(<span class="function-arg">dev_mode: <code>bool</code></span>) → <code>Any</code></h4><a class="permalink" href="#module-dev_mode-functions-override_dev_mode" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Create a context manager to change the dev-mode in a <code>with</code> block.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="module-dev_mode-functions-override_dev_mode-arguments" class="doc-part function-doc-part function-arguments" tabindex="-1" open><summary><h5 class="h">Arguments</h5><a class="permalink" href="#module-dev_mode-functions-override_dev_mode-arguments" title="Permalink to here">¶</a></summary><div id="module-dev_mode-functions-override_dev_mode-arguments-dev_mode" tabindex="0" class="content doc-part value value-named"><h6 class="h">dev_mode<span class="attr-details">: <code>bool</code></span></h6><a class="permalink" href="#module-dev_mode-functions-override_dev_mode-arguments-dev_mode" title="Permalink to here">¶</a><div class="docstring"><p>The dev-mode wanted inside the <code>with</code> block.</p></div></div></details> <details id="module-dev_mode-functions-override_dev_mode-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#module-dev_mode-functions-override_dev_mode-returns" title="Permalink to here">¶</a></summary><div id="module-dev_mode-functions-override_dev_mode-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>Any</code></h6><a class="permalink" href="#module-dev_mode-functions-override_dev_mode-returns-0" title="Permalink to here">¶</a></div></details> <details id="module-dev_mode-functions-override_dev_mode-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#module-dev_mode-functions-override_dev_mode-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">override_dev_mode</span><span class="p">,</span> <span class="n">in_dev_mode</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="k">with</span> <span class="n">override_dev_mode</span><span class="p">(</span><span class="kc">False</span><span class="p">):</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'off:'</span><span class="p">,</span> <span class="n">in_dev_mode</span><span class="p">())</span>
<span class="o">...</span> <span class="k">with</span> <span class="n">override_dev_mode</span><span class="p">(</span><span class="kc">True</span><span class="p">):</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'on:'</span><span class="p">,</span> <span class="n">in_dev_mode</span><span class="p">())</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'back off:'</span><span class="p">,</span> <span class="n">in_dev_mode</span><span class="p">())</span>
<span class="o">...</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'back on:'</span><span class="p">,</span> <span class="n">in_dev_mode</span><span class="p">())</span>
<span class="n">off</span><span class="p">:</span> <span class="kc">False</span>
<span class="n">on</span><span class="p">:</span> <span class="kc">True</span>
<span class="n">back</span> <span class="n">off</span><span class="p">:</span> <span class="kc">False</span>
<span class="n">back</span> <span class="n">on</span><span class="p">:</span> <span class="kc">True</span>
</pre></div>
</details></div></details></div></details><details id="module-dev_mode-functions-in_dev_mode" class="doc-part function function-function" tabindex="-1" open><summary><h4 class="h">in_dev_mode() → <code>bool</code></h4><a class="permalink" href="#module-dev_mode-functions-in_dev_mode" title="Permalink to here">¶</a></summary><div class="content"><div class="docstring"><p>Return the actual dev-mode.</p></div><details class="linked-to-parent"><summary>Details</summary><div class="content"> <details id="module-dev_mode-functions-in_dev_mode-returns" class="doc-part function-doc-part function-returns" tabindex="-1" open><summary><h5 class="h">Returns</h5><a class="permalink" href="#module-dev_mode-functions-in_dev_mode-returns" title="Permalink to here">¶</a></summary><div id="module-dev_mode-functions-in_dev_mode-returns-0" tabindex="0" class="content doc-part value value-unnamed"><h6 class="h"><code>bool</code></h6><a class="permalink" href="#module-dev_mode-functions-in_dev_mode-returns-0" title="Permalink to here">¶</a><div class="docstring"><p>The value of the actual dev-mode.</p></div></div></details> <details id="module-dev_mode-functions-in_dev_mode-example" class="doc-part function-doc-part function-example" tabindex="-1" open><summary><h5 class="h">Example</h5><a class="permalink" href="#module-dev_mode-functions-in_dev_mode-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">set_dev_mode</span><span class="p">,</span> <span class="n">unset_dev_mode</span><span class="p">,</span> <span class="n">in_dev_mode</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">True</span>
<span class="o">>>></span> <span class="n">unset_dev_mode</span><span class="p">()</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">False</span>
<span class="o">>>></span> <span class="n">set_dev_mode</span><span class="p">()</span>
<span class="o">>>></span> <span class="n">in_dev_mode</span><span class="p">()</span>
<span class="kc">True</span>
</pre></div>
</details></div></details></div></details></div></details></div></details><details id="Context" class="doc-part Context manual" tabindex="-1"><summary><h2 class="h">Context</h2><a class="permalink" href="#Context" title="Permalink to here">¶</a></summary><div class="content"><p><strong>Context provides a way to pass data through the component tree without having to
pass props down manually at every level.</strong></p><p>In a typical Mixt application, data is passed top-down (parent to child) via props,
but this can be cumbersome for certain types of props (e.g. locale preference,
UI theme, authenticated user...) that are required by many components within an
application.</p><p>Context provides a way to share values like these between components without
having to explicitly pass a prop through every level of the tree.</p><p>A context is a simple element than simply render its children, passing itself
down the tree. So every element in a tree under a context, gain this context.</p><p>You cannot pass anything to a context. A context has a <code>PropTypes</code> class
defining the expected props and their types.</p><p>You can have many contexts in the tree. They are merged so their children elements
can access props of all of them. You just cannot set the same prop in these
different contexts.</p><details id="Context-example" class="doc-part Context-doc-part Context-example" tabindex="-1" open><summary><h3 class="h">Example</h3><a class="permalink" href="#Context-example" title="Permalink to here">¶</a></summary><div class="code"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">mixt</span> <span class="kn">import</span> <span class="n">BaseContext</span><span class="p">,</span> <span class="n">Element</span><span class="p">,</span> <span class="n">NotProvided</span><span class="p">,</span> <span class="n">html</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">AuthenticatedContext</span><span class="p">(</span><span class="n">BaseContext</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">auth_username</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">>>></span> <span class="k">class</span> <span class="nc">App</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="k">if</span> <span class="n">cond</span><span class="o">=</span><span class="p">{</span><span class="n">context</span><span class="o">.</span><span class="n">prop</span><span class="p">(</span><span class="s1">'auth_username'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)}</span><span class="o">></span>
<span class="o">...</span> <span class="n">Welcome</span> <span class="n">back</span><span class="p">,</span> <span class="p">{</span><span class="n">context</span><span class="o">.</span><span class="n">auth_username</span><span class="p">}</span><span class="o">.</span>
<span class="o">...</span> <span class="o"></</span><span class="k">if</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="k">else</span><span class="o">></span>
<span class="o">...</span> <span class="n">Hello</span><span class="o">.</span> <span class="n">You</span> <span class="n">need</span> <span class="n">to</span> <span class="n">idenfify</span> <span class="n">yourself</span><span class="o">.</span>
<span class="o">...</span> <span class="o"></</span><span class="k">else</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">App</span> <span class="o">/></span><span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="o">.</span> <span class="n">You</span> <span class="n">need</span> <span class="n">to</span> <span class="n">idenfify</span> <span class="n">yourself</span><span class="o">.</</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="n">who</span> <span class="o">=</span> <span class="s1">'John'</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span>
<span class="o">...</span> <span class="o"><</span><span class="n">AuthenticatedContext</span> <span class="n">auth_username</span><span class="o">=</span><span class="p">{</span><span class="n">who</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">App</span> <span class="o">/></span>
<span class="o">...</span> <span class="o"></</span><span class="n">AuthenticatedContext</span><span class="o">></span>
<span class="o">...</span> <span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Welcome</span> <span class="n">back</span><span class="p">,</span> <span class="n">John</span><span class="o">.</</span><span class="n">div</span><span class="o">></span>
<span class="o">>>></span> <span class="n">who</span> <span class="o">=</span> <span class="n">NotProvided</span>
<span class="o">>>></span> <span class="nb">print</span><span class="p">(</span>
<span class="o">...</span> <span class="o"><</span><span class="n">AuthenticatedContext</span> <span class="n">auth_username</span><span class="o">=</span><span class="p">{</span><span class="n">who</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">App</span> <span class="o">/></span>
<span class="o">...</span> <span class="o"></</span><span class="n">AuthenticatedContext</span><span class="o">></span>
<span class="o">...</span> <span class="p">)</span>
<span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Hello</span><span class="o">.</span> <span class="n">You</span> <span class="n">need</span> <span class="n">to</span> <span class="n">idenfify</span> <span class="n">yourself</span><span class="o">.</</span><span class="n">div</span><span class="o">></span>
</pre></div>
</details></div></details><details id="module-collectors" class="doc-part module" tabindex="-1"><summary><h2 class="h">collectors</h2><a class="permalink" href="#module-collectors" title="Permalink to here">¶</a></summary><div class="content"><details open class="docstring"><summary><p>Provide the <code>*Collectors</code> classes to collect data (JS, CSS).</p></summary><div class="content"><p>Available collectors: <code class="reference">CSSCollector</code>, <code>JSCollector</code>.</p><p>Usage (we'll use <code>CSSCollector</code> in these examples but it works the same with <code>JSCollector</code>):</p><ol><li><p>Surround the content you want to collect from with a <code><CSSCollector></code>:</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="nb">print</span><span class="p">(</span><span class="o"><</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">Component</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">Component</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span><span class="p">)</span>
</pre></div>
</li><li><p>Collect things</p><ul><li><p>Via <code>CSSCollector.Collect</code></p><p>Everything that is inside a <code>CSSCollector.Collect</code> tag will be collected. If it's in a
component that is called many times, it will be collected each times.</p><p>It's important to encapsulate the text to collect in a raw string or text will be html-escaped
(for example <code>></code> will be converted to <code>&gt;</code> but we really want <code>></code> to be there), and
content of curly braces will be interpreted as "python" (because of the way "mixt" work).</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">Fragment</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span><span class="o">.</span><span class="n">Collect</span><span class="o">></span><span class="p">{</span><span class="n">h</span><span class="o">.</span><span class="n">Raw</span><span class="p">(</span><span class="s1">'''</span>
<span class="s1">... .somecontent { color: red; }</span>
<span class="s1">... '''</span><span class="p">)}</span><span class="o"></</span><span class="n">CSSCollector</span><span class="o">.</span><span class="n">Collect</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span> <span class="n">class</span><span class="o">=</span><span class="s2">"somecontent"</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">()}</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">Fragment</span><span class="o">></span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">():</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span><span class="o">.</span><span class="n">Collect</span><span class="o">></span><span class="p">{</span><span class="n">h</span><span class="o">.</span><span class="n">Raw</span><span class="p">(</span><span class="s1">'''</span>
<span class="s1">... * { color: black; }</span>
<span class="s1">... '''</span><span class="p">)}</span><span class="o"></</span><span class="n">CSSCollector</span><span class="o">.</span><span class="n">Collect</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">Component</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">div</span><span class="o">></span><span class="n">Foo</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">Component</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">body</span><span class="o">></span>
</pre></div>
<p>Here the collected content will be:</p><div class="code"><pre><span></span><span class="o">*</span> <span class="p">{</span> <span class="k">color</span><span class="p">:</span> <span class="kc">black</span><span class="p">;</span> <span class="p">}</span>
<span class="p">.</span><span class="nc">somecontent</span> <span class="p">{</span> <span class="k">color</span><span class="p">:</span> <span class="kc">red</span><span class="p">;</span> <span class="p">}</span>
</pre></div>
</li><li><p>Via the <code>render_css</code> method of a component</p><p>It works like the <code>Collect</code> component but allows to separate css from html by moving it
in a dedicated method.</p><p>This method will be called for every component having it. And like for <code>Collect</code>, if
a component is called many times, the output will be collected many times.</p><p>Taking our previous example, now the <code>Component</code> class is simpler. Also note how we don't
have to use <code>h.Raw</code> anymore: it's automatic.</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render_css</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="s1">'''</span>
<span class="s1">... .somecontent { color: red; }</span>
<span class="s1">... '''</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span> <span class="n">class</span><span class="o">=</span><span class="s2">"somecontent"</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">()}</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</li><li><p>Via the <code>render_css_global</code> method of a component</p><p>It works like the <code>render_css</code> method but it is a class method and is called only once
for each component.</p><p>You don't have to call <code>super</code> in this method: the collector will collect this method for
the parent classes too if any (using <code>super</code> would result in the content of the method in
the parent class to be collected many times).</p><p>So you can use <code>render_css_global</code> for global style for a component, and <code>render_css</code> for
the style belonging to a very specific instance.</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">class</span> <span class="nc">Component</span><span class="p">(</span><span class="n">Element</span><span class="p">):</span>
<span class="o">...</span> <span class="k">class</span> <span class="nc">PropTypes</span><span class="p">:</span>
<span class="o">...</span> <span class="n">color</span><span class="p">:</span> <span class="nb">str</span>
<span class="o">...</span>
<span class="o">...</span> <span class="nd">@classmethod</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render_css_global</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="s1">'''</span>
<span class="s1">... .somecontent { color: red; }</span>
<span class="s1">... '''</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render_css</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">has_prop</span><span class="p">(</span><span class="s2">"color"</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">return</span> <span class="s1">'''</span>
<span class="s1">... #</span><span class="si">%(id)s</span><span class="s1"> { color: </span><span class="si">%(color)s</span><span class="s1">; }</span>
<span class="s1">... '''</span> <span class="o">%</span> <span class="p">{</span><span class="s1">'id'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="s1">'color'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">}</span>
<span class="o">...</span>
<span class="o">...</span> <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">div</span> <span class="nb">id</span><span class="o">=</span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">}</span> <span class="n">class</span><span class="o">=</span><span class="s2">"somecontent"</span><span class="o">></span><span class="p">{</span><span class="bp">self</span><span class="o">.</span><span class="n">children</span><span class="p">()}</span><span class="o"></</span><span class="n">div</span><span class="o">></span>
</pre></div>
</li></ul></li><li><p>Display collected content</p><p>Now that the collected collected all the content, we need a way to render it.</p><ul><li><p>Via the <code>render_position</code> prop.</p><p>The collector accept a prop named <code>render_position</code> which, if set, must be either "before"
or "after". In this case, the content will be rendered in the tree just before the opening
of the collector tag, of just after its closing tag.</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">():</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># css will be rendered here in a ``<style>`` tag.</span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span> <span class="n">render_position</span><span class="o">=</span><span class="s2">"before"</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># ...</span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">body</span><span class="o">></span>
</pre></div>
<div class="code"><pre><span></span><span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">():</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span> <span class="n">render_position</span><span class="o">=</span><span class="s2">"after"</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># ...</span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># css will be rendered here in a ``<style>`` tag.</span>
<span class="o">...</span> <span class="o"></</span><span class="n">body</span><span class="o">></span>
</pre></div>
</li><li><p>Via the <code>ref</code> prop.</p><p>A ref allow to get a reference of a component and use it elsewhere. See <code>Ref</code> to know more.</p><p>Here, by keeping a reference to the collector we can decide where and when to render the
collected content.</p><ul><li><p>After the collector</p><p>We'll take advantage of the possibility to pass a callable as an element in the tree.</p><p>This callable will be called at the time of the conversion to string, so after the
rendering itself.</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="n">ref</span> <span class="o">=</span> <span class="n">Ref</span><span class="p">()</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">():</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span> <span class="n">ref</span><span class="o">=</span><span class="p">{</span><span class="n">ref</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># ...</span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="p">{</span><span class="n">ref</span><span class="o">.</span><span class="n">current</span><span class="o">.</span><span class="n">render_collected</span><span class="p">}</span>
<span class="o">...</span> <span class="o"></</span><span class="n">body</span><span class="o">></span>
</pre></div>
</li><li><p>Before the collector</p><p>There is a difference in using the ref before its initialization than after, because of
course it doesn't exist yet. So we cannot use <code>ref.current.render_collected</code> because
<code>ref.current</code> is not yet set.</p><p>But we can still use the callable idea, with a lambda, because the lambda will be called
at the end, when <code>ref.current</code> will be defined.</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="n">ref</span> <span class="o">=</span> <span class="n">Ref</span><span class="p">()</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">():</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">html</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">head</span><span class="o">></span>
<span class="o">...</span> <span class="p">{</span><span class="k">lambda</span><span class="p">:</span> <span class="n">ref</span><span class="o">.</span><span class="n">current</span><span class="o">.</span><span class="n">render_collected</span><span class="p">()}</span>
<span class="o">...</span> <span class="o"></</span><span class="n">head</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span> <span class="n">ref</span><span class="o">=</span><span class="p">{</span><span class="n">ref</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># ...</span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">html</span><span class="o">></span>
</pre></div>
</li><li><p>Outside of the tree</p><p>You may want to extract the collected content to save it to a file, for example.</p><p>We can use the ref for this, and pass <code>with_tag=False</code> to <code>render_collected</code> to not
have the colected content surrounded by a <code><style></code> tag:</p><div class="code"><pre><span></span><span class="o">>>></span> <span class="n">ref</span> <span class="o">=</span> <span class="n">Ref</span><span class="p">()</span>
<span class="o">>>></span> <span class="k">def</span> <span class="nf">render</span><span class="p">():</span>
<span class="o">...</span> <span class="k">return</span> <span class="o"><</span><span class="n">body</span><span class="o">></span>
<span class="o">...</span> <span class="o"><</span><span class="n">CSSCollector</span> <span class="n">ref</span><span class="o">=</span><span class="p">{</span><span class="n">ref</span><span class="p">}</span><span class="o">></span>
<span class="o">...</span> <span class="c1"># ...</span>
<span class="o">...</span> <span class="o"></</span><span class="n">CSSCollector</span><span class="o">></span>
<span class="o">...</span> <span class="o"></</span><span class="n">body</span><span class="o">></span>
<span class="o">>>></span> <span class="n">save_to_file</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">render</span><span class="p">()),</span> <span class="s1">'index.html'</span><span class="p">)</span>