Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conduct prop audit as a team #6690

Closed
joshblack opened this issue Aug 18, 2020 · 5 comments
Closed

Conduct prop audit as a team #6690

joshblack opened this issue Aug 18, 2020 · 5 comments
Assignees
Labels
package: react carbon-components-react role: dev 🤖

Comments

@joshblack
Copy link
Contributor

joshblack commented Aug 18, 2020

This issue is to conduct a prop audit as a team and determine next steps for prop conventions or renames for the next major release.

Topics to discuss:

  • Conventions for className
  • Conventions for ref
  • Conventions for event handler signatures
  • Convention for open vs isOpen
  • Convention for render* props
  • Convention for aria-label vs label
  • Convention for size variants
    • Do we use a size prop, or is the size itself a prop?

Related issues:

@joshblack joshblack added role: dev 🤖 package: react carbon-components-react labels Aug 18, 2020
@joshblack
Copy link
Contributor Author

Components

Accordion

  • children
  • className
  • align

AccordionItem

  • children
  • className
  • title
  • renderExpando
  • iconDescription
  • open
  • onClick
  • onHeadingClick

Breadcrumb

  • aria-label
  • children
  • className
  • noTrailingSlash

BreadcrumbItem

  • aria-current
  • children
  • className
  • href
  • isCurrentPage

Button

  • children
  • as
  • className
  • disabled
  • size
  • small
  • kind
  • href
  • tabIndex
  • type
  • role
  • renderIcon
  • iconDescription
  • hasIconOnly
  • tooltipPosition
  • tooltipAlignment

Checkbox

  • checked
  • defaultChecked
  • indeterminate
  • className
  • disabled
  • id
  • labelText
  • hideLabel
  • onChange
  • title
  • wrapperClassName

CodeSnippet

  • type
  • className
  • children
  • feedback
  • copyButtonDescription
  • onClick
  • copyLabel
  • ariaLabel
  • showMoreText
  • showLessText
  • light
  • hideCopyButton

ComboBox

  • ariaLabel
  • className
  • disabled
  • id
  • initialSelectedItem
  • items
  • itemToString
  • itemToElement
  • onChange
  • placeholder
  • shouldFilterItem
  • invalid
  • invalidText
  • selectedItem
  • translateWithId
  • type
  • size
  • onInputChange
  • light
  • downshiftProps
  • direction
  • titleText
  • helperText

ComposedModal

  • className
  • containerClassName
  • onClose
  • onKeyDown
  • open
  • selectorPrimaryFocus
  • selectorsFloatingMenus
  • children
  • danger
  • size

ModalHeader

  • className
  • labelClassName
  • titleClassName
  • closeClassName
  • closeIconClassName
  • label
  • title
  • children
  • iconDescription
  • closeModal
  • buttonOnClick

ModalBody

  • className
  • children
  • hasForm
  • hasScrollingContent
  • aria-label

ModalFooter

  • className
  • primaryClassName
  • primaryButtonText
  • primaryButtonDisabled
  • secondaryClassName
  • secondaryButtonText
  • danger
  • onRequestClose
  • onRequestSubmit
  • closeModal
  • children
  • inputref

ContentSwitcher

  • children
  • className
  • light
  • onChange
  • selectedIndex
  • selectionMode

Copy

  • children
  • className
  • feedback
  • feedbackTimeout
  • onClick
  • onAnimationEnd

CopyButton

  • className
  • iconDescription
  • feedback
  • feedbackTimeout
  • onClick

DataTable

  • rows
  • headers
  • sortRow
  • filterRows
  • locale
  • translateWithId
  • size
  • radio
  • stickyHeader
  • isSortable
  • overflowMenuOnHover
  • useZebraStyles
  • useStaticWidth
  • shouldShowBorder

Table

  • className
  • useZebraStyles
  • size
  • useStaticWidth
  • shouldShowBorder
  • isSortable
  • stickyHeader
  • overflowMenuOnHover
  • children

TableActionList

  • className

TableBatchAction

  • hasIconOnly
  • iconDescription
  • renderIcon

TableBatchActions

  • children
  • className
  • shouldShowBatchActions
  • totalSelected
  • onCancel
  • translateWithId

TableBody

  • className
  • children
  • aria-live

TableCell

  • className

TableContainer

  • className
  • children
  • title
  • description
  • stickyHeader

TableExpandHeader

  • className
  • children
  • enableExpando
  • ariaLabel
  • isExpanded
  • onExpand
  • expandIconDescription

TableExpandRow

  • ariaLabel
  • className
  • children
  • isExpanded
  • isSelected
  • onExpand
  • expandIconDescription
  • expandHeader

TableExpandedRow

  • children
  • className
  • colSpan

TableHead

  • className

TableHeader

  • className
  • children
  • colSpan
  • isSortable
  • isSortHeader
  • onClick
  • scope
  • sortDirection
  • translateWithId

TableRow

  • className
  • isSelected

TableSelectAll

  • ariaLabel
  • checked
  • id
  • indeterminate
  • name
  • onSelect
  • className
  • disabled

TableSelectRow

  • ariaLabel
  • checked
  • disabled
  • id
  • name
  • onSelect
  • radio
  • className

TableToolbar

  • children
  • size
  • aria-label
  • aria-labelledby

TableToolbarAction

  • children
  • className
  • onClick

TableToolbarContent

  • className

TableToolbarSearch

  • children
  • className
  • id
  • searchContainerClass
  • expanded
  • defaultExpanded
  • onExpand
  • onChange
  • placeHolderText
  • labelText
  • defaultValue
  • translateWithId
  • tabIndex
  • persistent
  • persistant

TableToolbarMenu

  • children
  • className
  • renderIcon
  • iconDescription

DatePicker

  • children
  • className
  • short
  • light
  • datePickerType
  • dateFormat
  • locale
  • value
  • appendTo
  • onChange
  • onClose
  • minDate
  • maxDate

DatePickerInput

  • id
  • iconDescription
  • labelText
  • size
  • pattern
  • type
  • disabled
  • invalid
  • invalidText
  • hideLabel
  • placeholder
  • datePickerType
  • onClick
  • openCalendar
  • onChange

Dropdown

  • disabled
  • className
  • items
  • initialSelectedItem
  • id
  • inline
  • invalid
  • invalidText
  • itemToString
  • itemToElement
  • onChange
  • label
  • translateWithId
  • ariaLabel
  • type
  • size
  • selectedItem
  • light
  • titleText
  • helperText
  • direction
  • downshiftProps

ErrorBoundary

  • children
  • fallback

FileUploader

  • iconDescription
  • buttonLabel
  • buttonKind
  • filenameStatus
  • labelDescription
  • labelTitle
  • multiple
  • name
  • onChange
  • onDelete
  • onClick
  • className
  • accept
  • size

Filename

  • iconDescription
  • status
  • tabIndex
  • invalid

FileUploaderButton

  • className
  • disableLabelChanges
  • id
  • labelText
  • listFiles
  • multiple
  • name
  • onChange
  • onClick
  • role
  • tabIndex
  • buttonKind
  • accept
  • disabled
  • size

FileUploaderDropContainer

  • className
  • id
  • labelText
  • multiple
  • name
  • role
  • tabIndex
  • disabled
  • accept
  • onAddFiles
  • size

FileUploaderItem

  • uuid
  • name
  • status
  • size
  • iconDescription
  • invalid
  • onDelete
  • errorSubject
  • errorBody

Form

  • children
  • className

FluidForm

  • children
  • className

FormGroup

  • children
  • legendText
  • className
  • invalid
  • message
  • messageText

FormItem

  • children
  • className

FormLabel

  • children
  • className
  • id

Grid

  • as
  • condensed
  • narrow
  • fullWidth
  • className
  • children

Row

  • as
  • condensed
  • narrow
  • className
  • children

Column

  • as
  • sm
  • md
  • lg
  • xlg
  • max
  • className
  • children

Icon

  • className
  • name
  • iconTitle
  • description
  • fill
  • fillRule
  • height
  • icon
  • role
  • style
  • viewBox
  • width
  • iconRef

InlineLoading

  • className
  • success
  • status
  • description
  • iconDescription
  • onSuccess
  • successDelay

Link

  • children
  • className
  • href
  • disabled
  • inline
  • visited

ListItem

  • children
  • className

Loading

  • id
  • active
  • className
  • withOverlay
  • small
  • description

Modal

  • children
  • className
  • passiveModal
  • hasForm
  • onRequestClose
  • id
  • modalHeading
  • modalLabel
  • modalAriaLabel
  • secondaryButtonText
  • primaryButtonText
  • open
  • onRequestSubmit
  • onKeyDown
  • iconDescription
  • primaryButtonDisabled
  • onSecondarySubmit
  • danger
  • alert
  • shouldSubmitOnEnter
  • selectorsFloatingMenus
  • selectorPrimaryFocus
  • size
  • focusTrap
  • hasScrollingContent
  • aria-label

ModalWrapper

  • status
  • handleOpen
  • children
  • id
  • buttonTriggerText
  • buttonTriggerClassName
  • modalLabel
  • modalHeading
  • modalText
  • passiveModal
  • withHeader
  • modalBeforeContent
  • primaryButtonText
  • secondaryButtonText
  • handleSubmit
  • disabled
  • renderTriggerButtonIcon
  • triggerButtonIconDescription
  • triggerButtonKind
  • shouldCloseAfterSubmit
  • onKeyDown
  • selectorPrimaryFocus

MultiSelect

  • compareItems
  • sortItems
  • disabled
  • id
  • items
  • initialSelectedItems
  • itemToString
  • label
  • locale
  • onChange
  • type
  • size
  • useTitleInItem
  • light
  • invalid
  • invalidText
  • open
  • translateWithId
  • selectionFeedback
  • downshiftProps
  • direction

ToastNotification

  • children
  • className
  • kind
  • lowContrast
  • title
  • subtitle
  • role
  • caption
  • onCloseButtonClick
  • iconDescription
  • statusIconDescription
  • notificationType
  • hideCloseButton
  • timeout

InlineNotification

  • actions
  • children
  • className
  • kind
  • lowContrast
  • title
  • subtitle
  • role
  • onCloseButtonClick
  • iconDescription
  • statusIconDescription
  • notificationType
  • hideCloseButton

NotificationActionButton

  • className
  • children
  • onClick

NotificationButton

  • className
  • ariaLabel
  • type
  • iconDescription
  • renderIcon
  • name
  • notificationType

NotificationTextDetails

  • children
  • title
  • subtitle
  • caption
  • notificationType

OrderedList

  • children
  • className
  • nested

OverflowMenuItem

  • className
  • wrapperClassName
  • itemText
  • href
  • hasDivider
  • isDelete
  • disabled
  • onBlur
  • onClick
  • onFocus
  • onKeyDown
  • onKeyUp
  • onMouseDown
  • onMouseEnter
  • onMouseLeave
  • onMouseUp
  • closeMenu
  • primaryFocus
  • requireTitle
  • index
  • handleOverflowMenuItemFocus

Pagination

  • backwardText
  • className
  • itemRangeText
  • forwardText
  • id
  • itemsPerPageText
  • itemText
  • onChange
  • pageNumberText
  • pageRangeText
  • pageText
  • pageSizes
  • totalItems
  • disabled
  • page
  • pageSize
  • pagesUnknown
  • isLastPage
  • pageInputDisabled

PaginationNav

  • className
  • onChange
  • totalItems
  • itemsShown
  • page
  • loop
  • translateWithId

ProgressIndicator

  • children
  • className
  • currentIndex
  • onChange
  • vertical
  • spaceEqually

ProgressStep

  • index
  • label
  • className
  • current
  • complete
  • description
  • invalid
  • secondaryLabel
  • renderLabel
  • overflowTooltipProps
  • disabled
  • tooltipId
  • onClick
  • translateWithId

RadioButtonGroup

  • children
  • className
  • defaultSelected
  • orientation
  • labelPosition
  • name
  • disabled
  • onChange
  • valueSelected

Search

  • className
  • type
  • small
  • size
  • placeHolderText
  • labelText
  • light
  • id
  • closeButtonLabelText
  • value
  • defaultValue
  • onChange

SearchFilterButton

  • labelText
  • iconDescription

SearchLayoutButton

  • format
  • labelText
  • iconDescriptionList
  • iconDescriptionGrid
  • onChangeFormat

Select

  • children
  • className
  • id
  • inline
  • labelText
  • onChange
  • disabled
  • defaultValue
  • iconDescription
  • hideLabel
  • invalid
  • invalidText
  • helperText
  • light
  • noLabel
  • size

SelectItem

  • value
  • className
  • disabled
  • hidden
  • text

SelectItemGroup

  • children
  • className
  • disabled
  • label

Switch

  • className
  • disabled
  • index
  • name
  • onClick
  • onKeyDown
  • selected
  • text

Slider

  • className
  • hideTextInput
  • id
  • onChange
  • onRelease
  • value
  • min
  • minLabel
  • max
  • maxLabel
  • formatLabel
  • labelText
  • step
  • stepMuliplier
  • stepMultiplier
  • children
  • disabled
  • name
  • inputType
  • ariaLabelInput
  • light
  • required
  • invalid

StructuredListWrapper

  • children
  • className
  • border
  • selection
  • ariaLabel

StructuredListHead

  • children
  • className

StructuredListBody

  • children
  • className
  • head
  • onKeyDown

StructuredListRow

  • children
  • className
  • head
  • label
  • tabIndex
  • onKeyDown

StructuredListInput

  • className
  • id
  • value
  • name
  • title
  • defaultChecked
  • onChange

StructuredListCell

  • children
  • className
  • head
  • noWrap

Tab

  • id
  • className
  • handleTabClick
  • handleTabKeyDown
  • disabled
  • href
  • index
  • label
  • role
  • onClick
  • onKeyDown
  • selected
  • tabIndex
  • renderAnchor
  • renderContent

TabContent

  • className
  • selected
  • children

Tabs

  • ariaLabel
  • children
  • className
  • hidden
  • role
  • type
  • onClick
  • onKeyDown
  • onSelectionChange
  • triggerHref
  • selected
  • iconDescription
  • tabContentClassName
  • selectionMode

Tag

  • children
  • className
  • type
  • disabled
  • filter
  • title
  • onClose
  • id

TextArea

  • className
  • cols
  • defaultValue
  • disabled
  • id
  • labelText
  • onChange
  • onClick
  • placeholder
  • rows
  • value
  • invalid
  • invalidText
  • helperText
  • hideLabel
  • light

TextInput

  • className
  • defaultValue
  • disabled
  • id
  • labelText
  • onChange
  • onClick
  • placeholder
  • size
  • type
  • value
  • hideLabel
  • invalid
  • invalidText
  • warn
  • warnText
  • helperText
  • light
  • inline

Tile

  • children
  • className
  • light

ClickableTile

  • children
  • className
  • href
  • rel
  • light
  • handleClick
  • handleKeyDown

SelectableTile

  • children
  • className
  • selected
  • id
  • value
  • name
  • title
  • onChange
  • iconDescription
  • tabIndex
  • light
  • handleClick
  • handleKeyDown

ExpandableTile

  • children
  • className
  • expanded
  • onBeforeClick
  • tabIndex
  • tileCollapsedIconText
  • tileExpandedIconText
  • id
  • light
  • handleClick

TileAboveTheFoldContent

  • children

TileBelowTheFoldContent

  • children

RadioTile

  • checked
  • children
  • className
  • defaultChecked
  • id
  • name
  • iconDescription
  • onChange
  • value
  • tabIndex
  • light

TileGroup

  • children
  • className
  • defaultSelected
  • name
  • disabled
  • onChange
  • legend
  • valueSelected

TimePicker

  • children
  • className
  • id
  • labelText
  • onClick
  • onChange
  • onBlur
  • type
  • pattern
  • placeholder
  • maxLength
  • invalid
  • invalidText
  • hideLabel
  • disabled
  • value
  • light

TimePickerSelect

  • children
  • className
  • id
  • inline
  • disabled
  • defaultValue
  • iconDescription
  • hideLabel
  • labelText

Toggle

  • className
  • defaultToggled
  • onToggle
  • onChange
  • id
  • toggled
  • labelText
  • aria-label
  • labelA
  • labelB

ToggleSmall

  • className
  • defaultToggled
  • onToggle
  • onChange
  • id
  • toggled
  • labelText
  • aria-label
  • labelA
  • labelB

Toolbar

  • children
  • className

ToolbarItem

  • children
  • type
  • placeHolderText

ToolbarTitle

  • title

ToolbarOption

  • children

ToolbarSearch

  • children
  • className
  • type
  • small
  • placeHolderText
  • labelText
  • id
  • role
  • labelId

TooltipDefinition

  • children
  • className
  • triggerClassName
  • direction
  • align
  • id
  • tooltipText
  • onFocus
  • onMouseEnter
  • onMouseLeave

TooltipIcon

  • children
  • className
  • direction
  • align
  • id
  • tooltipText
  • onFocus
  • onMouseEnter

UnorderedList

  • children
  • className
  • nested

SkeletonText

  • paragraph
  • lineCount
  • width
  • heading
  • className

SkeletonPlaceholder

  • className

DataTableSkeleton

  • rowCount
  • columnCount
  • zebra
  • compact
  • headers
  • className
  • showHeader
  • showToolbar

AccordionSkeleton

  • open
  • count
  • uid
  • className
  • align

BreadcrumbSkeleton

  • className

ButtonSkeleton

  • small
  • href
  • className

CheckboxSkeleton

  • className

CodeSnippetSkeleton

  • type
  • className

DropdownSkeleton

  • inline
  • className

FileUploaderSkeleton

  • className

NumberInputSkeleton

  • hideLabel
  • className

PaginationSkeleton

  • className

ProgressIndicatorSkeleton

  • className

RadioButtonSkeleton

  • className

SearchSkeleton

  • small
  • className

SelectSkeleton

  • hideLabel
  • className

SliderSkeleton

  • hideLabel
  • className

StructuredListSkeleton

  • rowCount
  • border
  • className

TabsSkeleton

  • className

TagSkeleton

  • className

TextAreaSkeleton

  • hideLabel
  • className

TextInputSkeleton

  • hideLabel
  • className

ToggleSkeleton

  • id
  • labelText
  • aria-label
  • className

ToggleSmallSkeleton

  • id
  • labelText
  • aria-label
  • className

IconSkeleton

  • style
  • className

DatePickerSkeleton

  • range
  • className
  • id

PageSelector

  • className
  • currentPage
  • id
  • labelText
  • totalPages

Unstable_Pagination

  • backwardText
  • children
  • className
  • disabled
  • forwardText
  • id
  • itemsPerPageText
  • itemRangeText
  • itemText
  • initialPage
  • pageRangeText
  • pageSize
  • pageSizes
  • pageText
  • pagesUnknown
  • totalItems

Content

  • className
  • children
  • tagName

Header

  • aria-label
  • aria-labelledby
  • className

HeaderContainer

  • isSideNavExpanded

HeaderGlobalAction

  • aria-label
  • aria-labelledby
  • children
  • className
  • onClick
  • isActive

HeaderGlobalBar

  • className

HeaderMenuButton

  • aria-label
  • aria-labelledby
  • className
  • onClick
  • isActive

HeaderMenuItem

  • element
  • isSideNavExpanded
  • className
  • children
  • role
  • isCurrentPage

HeaderName

  • element
  • isSideNavExpanded
  • children
  • className
  • prefix
  • href

HeaderNavigation

  • aria-label
  • aria-labelledby
  • className
  • children

HeaderPanel

  • aria-label
  • aria-labelledby
  • className
  • expanded

HeaderSideNavItems

  • className
  • hasDivider
  • children

Switcher

  • aria-label
  • aria-labelledby
  • className
  • children

SwitcherItem

  • aria-label
  • aria-labelledby
  • className
  • children

SwitcherDivider

  • className

SkipToContent

  • className
  • children
  • href
  • tabIndex

SideNav

  • expanded
  • defaultExpanded
  • onToggle
  • aria-label
  • aria-labelledby
  • className
  • translateById
  • isChildOfHeader
  • isRail
  • isFixedNav
  • isPersistent
  • addFocusListeners
  • addMouseListeners

SideNavDetails

  • className
  • children
  • title

SideNavFooter

  • assistiveText
  • expanded
  • onToggle
  • isSideNavExpanded
  • className

SideNavHeader

  • className
  • renderIcon
  • isSideNavExpanded
  • children

SideNavIcon

  • className
  • children
  • small

SideNavItem

  • className
  • children
  • large

SideNavItems

  • className
  • children
  • isSideNavExpanded

SideNavLink

  • element
  • isSideNavExpanded
  • className
  • renderIcon
  • children
  • large

SideNavLinkText

  • children
  • className

SideNavMenuItem

  • children
  • className
  • isActive

SideNavSwitcher

  • className
  • labelText
  • onChange
  • options

@joshblack
Copy link
Contributor Author

Frequency

Prop name Frequency
className 149
children 91
id 38
disabled 29
onChange 27
iconDescription 21
labelText 21
onClick 20
size 17
light 17
aria-label 16
type 15
name 15
invalid 13
title 12
hideLabel 12
tabIndex 11
role 10
ariaLabel 10
value 10
href 9
translateWithId 9
onKeyDown 9
aria-labelledby 9
invalidText 8
small 7
label 7
isSideNavExpanded 7
renderIcon 6
defaultValue 6
inline 6
open 5
placeholder 5
direction 5
helperText 5
description 5
expanded 5
selected 5
align 4
as 4
checked 4
placeHolderText 4
status 4
notificationType 4
index 4
onToggle 4
kind 3
defaultChecked 3
feedback 3
items 3
itemToString 3
downshiftProps 3
onClose 3
selectorPrimaryFocus 3
danger 3
primaryButtonText 3
secondaryButtonText 3
locale 3
stickyHeader 3
isSortable 3
onExpand 3
multiple 3
accept 3
subtitle 3
itemText 3
onFocus 3
onMouseEnter 3
totalItems 3
head 3
handleClick 3
isActive 3
element 3
isCurrentPage 2
hasIconOnly 2
indeterminate 2
wrapperClassName 2
initialSelectedItem 2
itemToElement 2
selectedItem 2
titleText 2
selectorsFloatingMenus 2
closeModal 2
hasForm 2
hasScrollingContent 2
primaryButtonDisabled 2
onRequestClose 2
onRequestSubmit 2
selectionMode 2
feedbackTimeout 2
rows 2
headers 2
radio 2
overflowMenuOnHover 2
useZebraStyles 2
useStaticWidth 2
shouldShowBorder 2
isExpanded 2
expandIconDescription 2
isSelected 2
colSpan 2
onSelect 2
defaultExpanded 2
datePickerType 2
pattern 2
buttonKind 2
onDelete 2
condensed 2
narrow 2
max 2
style 2
width 2
passiveModal 2
modalHeading 2
modalLabel 2
lowContrast 2
caption 2
onCloseButtonClick 2
statusIconDescription 2
hideCloseButton 2
nested 2
hasDivider 2
onBlur 2
onMouseLeave 2
backwardText 2
itemRangeText 2
forwardText 2
itemsPerPageText 2
pageRangeText 2
pageText 2
pageSizes 2
page 2
pageSize 2
pagesUnknown 2
defaultSelected 2
valueSelected 2
hidden 2
text 2
border 2
handleKeyDown 2
defaultToggled 2
toggled 2
labelA 2
labelB 2
tooltipText 2
rowCount 2
large 2
renderExpando 1
onHeadingClick 1
noTrailingSlash 1
aria-current 1
tooltipPosition 1
tooltipAlignment 1
copyButtonDescription 1
copyLabel 1
showMoreText 1
showLessText 1
hideCopyButton 1
shouldFilterItem 1
onInputChange 1
containerClassName 1
labelClassName 1
titleClassName 1
closeClassName 1
closeIconClassName 1
buttonOnClick 1
primaryClassName 1
secondaryClassName 1
inputref 1
selectedIndex 1
onAnimationEnd 1
sortRow 1
filterRows 1
shouldShowBatchActions 1
totalSelected 1
onCancel 1
aria-live 1
enableExpando 1
expandHeader 1
isSortHeader 1
scope 1
sortDirection 1
searchContainerClass 1
persistent 1
persistant 1
short 1
dateFormat 1
appendTo 1
minDate 1
maxDate 1
openCalendar 1
fallback 1
buttonLabel 1
filenameStatus 1
labelDescription 1
labelTitle 1
disableLabelChanges 1
listFiles 1
onAddFiles 1
uuid 1
errorSubject 1
errorBody 1
legendText 1
message 1
messageText 1
fullWidth 1
sm 1
md 1
lg 1
xlg 1
iconTitle 1
fill 1
fillRule 1
height 1
icon 1
viewBox 1
iconRef 1
success 1
onSuccess 1
successDelay 1
visited 1
active 1
withOverlay 1
modalAriaLabel 1
onSecondarySubmit 1
alert 1
shouldSubmitOnEnter 1
focusTrap 1
handleOpen 1
buttonTriggerText 1
buttonTriggerClassName 1
modalText 1
withHeader 1
modalBeforeContent 1
handleSubmit 1
renderTriggerButtonIcon 1
triggerButtonIconDescription 1
triggerButtonKind 1
shouldCloseAfterSubmit 1
compareItems 1
sortItems 1
initialSelectedItems 1
useTitleInItem 1
selectionFeedback 1
timeout 1
actions 1
isDelete 1
onKeyUp 1
onMouseDown 1
onMouseUp 1
closeMenu 1
primaryFocus 1
requireTitle 1
handleOverflowMenuItemFocus 1
pageNumberText 1
isLastPage 1
pageInputDisabled 1
itemsShown 1
loop 1
currentIndex 1
vertical 1
spaceEqually 1
current 1
complete 1
secondaryLabel 1
renderLabel 1
overflowTooltipProps 1
tooltipId 1
orientation 1
labelPosition 1
closeButtonLabelText 1
format 1
iconDescriptionList 1
iconDescriptionGrid 1
onChangeFormat 1
noLabel 1
hideTextInput 1
onRelease 1
min 1
minLabel 1
maxLabel 1
formatLabel 1
step 1
stepMuliplier 1
stepMultiplier 1
inputType 1
ariaLabelInput 1
required 1
selection 1
noWrap 1
handleTabClick 1
handleTabKeyDown 1
renderAnchor 1
renderContent 1
onSelectionChange 1
triggerHref 1
tabContentClassName 1
filter 1
cols 1
warn 1
warnText 1
rel 1
onBeforeClick 1
tileCollapsedIconText 1
tileExpandedIconText 1
legend 1
maxLength 1
labelId 1
triggerClassName 1
paragraph 1
lineCount 1
heading 1
columnCount 1
zebra 1
compact 1
showHeader 1
showToolbar 1
count 1
uid 1
range 1
currentPage 1
totalPages 1
initialPage 1
tagName 1
prefix 1
translateById 1
isChildOfHeader 1
isRail 1
isFixedNav 1
isPersistent 1
addFocusListeners 1
addMouseListeners 1
assistiveText 1
options 1

@joshblack joshblack changed the title Conduct prop name audit as a team Conduct prop audit as a team Aug 18, 2020
@metonym
Copy link
Collaborator

metonym commented Aug 18, 2020

@joshblack This is a great initiative.

Some thoughts regarding...

shortening boolean prop names

- isFixed
+ fixed

- isExpanded
+ expanded

- useStaticWidth
+ staticWidth // is this a boolean or some other value?

fixed is more concise than isFixed and both are arguably unambiguous in what they do.

However, this wouldn't apply to all boolean prop names. Consider the case of renaming useStaticWidth to staticWidth. It becomes less clear what type it is, given that staticWidth is a noun and not an adjective.

signaling if a number prop type is indexed or non-indexed

For pagination/ordering related components, it's unclear if the prop value should begin at 0 or not.

For instance, the "page" prop for PaginationNav starts at 0 while the "page" prop for Pagination starts at 1.

This could be improved by appending "index" to any index prop.

- page
+ pageIndex

using "text" in the prop name to signal a string type

Personally, I find it useful when a prop name has "text" appended to it.

  • assistiveText
  • labelText

This signals to me that the type is expected to be a string. Whereas for something with different types (i.e. "label"), I assume that it could be a string or React node.

One nitpick is that I would prefer the native HTML attribute name where possible. So for something like "placeholderText," I would rather it be named "placeholder."

@joshblack
Copy link
Contributor Author

@metonym thanks for the input! Love these ideas.

Only one note, for the shortening prop name step I believe we'll move forward with isFixed instead of fixed. The rationale being that lowercase prop names can be confused with DOM attributes in some cases. There is also confusion as to if states named similarly to something like active correspond to the initial state or the current state. This is something which is* can help to address as a naming convention 👍

We can definitely do this on a case-by-case basis, but might make more sense just to have one convention across the codebase so the API becomes more guess-able instead of being component-specific.

@joshblack
Copy link
Contributor Author

Going to close this in favor specific audit lists 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: react carbon-components-react role: dev 🤖
Projects
None yet
Development

No branches or pull requests

3 participants