Convert kebab-case to camelCase
Transform kebab-case CSS properties and HTML attributes to JavaScript camelCase format. Essential for React inline styles, CSS-in-JS, and DOM manipulation.
0 characters
0 characters
Examples: kebab-case to camelCase
Input (kebab-case):
background-color
Output (camelCase):
backgroundColor
Usage:
style={{ backgroundColor: '#fff' }}
Input (kebab-case):
margin-top
Output (camelCase):
marginTop
Usage:
element.style.marginTop = '20px'
Input (kebab-case):
font-size
Output (camelCase):
fontSize
Usage:
const styles = { fontSize: '16px' }
Input (kebab-case):
border-radius
Output (camelCase):
borderRadius
Usage:
borderRadius: '8px'
Input (kebab-case):
data-user-id
Output (camelCase):
dataUserId
Usage:
const userId = element.dataset.userId
When to Use kebab-case
- URL slugs and paths
- CSS class names
- HTML attributes
- npm package names
Common in:
CSSHTMLURLsnpmKubernetes
When to Use camelCase
- JavaScript variable and function names
- Java method names
- TypeScript properties
- React component props
Common in:
JavaScriptTypeScriptJavaSwiftKotlin