
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
react-overridable
Advanced tools
With react-overridable you can mark your React components as overridable
and allow other apps to customize them. This can be useful when creating
libraries with a default implementation of components which requires to be
overridden at runtime.
You can inject new props, override render elements or the component itself.
Create a React component and mark it as overridable:
import PropTypes from 'prop-types';
import React, {Component} from 'react';
import Overridable, {parametrize, OverridableContext} from 'react-overridable';
class TitleComponent extends Component {
static propTypes = {
title: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
};
static defaultProps = {
children: null,
};
render() {
const {title, children} = this.props;
return (
<Overridable id="TitleComponent.container" title={title}>
<>
<div>{title}</div>
{children}
</>
</Overridable>
);
}
}
export const OverridableExampleComponent = Overridable.component('TitleComponent', TitleComponent);
In this example, the TitleComponent is marked as overridable inside the
render function, via the React component <Overridable /> and then exported
via the Higher-Order component Overridable.component.
Each overridable component is identified by a unique id.
After marking components as overridable, there are 3 ways that you can use to override:
parametrize: define new props to override the default component props.const parametrized = parametrize(OverridableExampleComponent, {
title: 'My new title',
});
// create a map {<component id>: <parametrized props>}
const overriddenComponents = {TitleComponent: parametrized};
const overriddenRenderElement = ({title}) => (
<h1>{title}</h1>
);
// create a map {<render element id>: <new render elements>}
const overriddenComponents = {TitleComponent.container: overriddenRenderElement};
const NewComponent = () => <strong>This is a new title</strong>;
// create a map {<component id>: <new component>}
const overriddenComponents = {TitleComponent: NewComponent};
In your app, inject the map of ids-components in the React Context
OverridableContext so that the react-overridable library can
use it and replace components when the default are rendered:
class App extends Component {
render() {
return (
<OverridableContext.Provider value={overriddenComponents}>
<....>
</OverridableContext.Provider>
)
}
}
On a large or complex page it can be difficult to find the IDs of overridable components, and looking through the source code manually is time consuming.
The library therefore includes a lightweight developer tool to aid with ID discovery.
To enable this feature, run reactOverridableEnableDevMode() in your browser console.
Then, hover over any overridable element to see a small label containing its ID.
To install the library, you will have to install the peer dependencies.
npm i react-overridable
npm i <peer dependencies>
To run tests:
npm run test
To build the library:
npm run build
In applying the MIT license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction.
1.0.0 (Sep 11, 2025)
FAQs
Makes React components overridable.
We found that react-overridable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.