Skip to content

Packages

DXP offers a handful of NPM packages to make your life easier.

Terminal window
npm install --save-dev @tmedxp/styleguide
import '@tmedxp/styleguide/main.css'; // styleguide without tokens
import '@tmedxp/styleguide/toyota.css'; // styleguide with toyota tokens
import '@tmedxp/styleguide/toyota/icons'; // toyota icons reference
import '@tmedxp/styleguide/lexus.css'; // styleguide with lexus tokens
import '@tmedxp/styleguide/lexus/icons'; // lexus icons reference
Terminal window
npm install --save-dev @tmdxp/dxp-headless-components
import { Overlay } from '@tmdxp/dxp-headless-components';
export const Component = () => <Overlay />;

You can use our browserslist config when building / bundling your styles or JavaScript.

This will automatically compile your code to support our Browser Support Matrix.

Terminal window
npm install --save-dev @tmedxp/browserslist-config
babel.config.js
import browserslistTargets from '@tmedxp/browserslist-config/targets';
export default {
presets: [['@babel/preset-env', { targets: browserslistTargets }]],
};
postcss.config.js
import browserslistTargets from '@tmedxp/browserslist-config/targets';
import postcssPresetEnv from 'postcss-preset-env';
export default {
plugins: [postcssPresetEnv({ browsers: browserslistTargets })],
};
Terminal window
npm install --save-dev @tmedxp/eslint-config
eslint.config.js
import dxpConfig from '@tmedxp/eslint-config';
export default [
...dxpConfig,
// { /* Add your own plugins and rules */ },
];
Terminal window
npm install --save-dev @tmedxp/prettier-config
package.json
{
"prettier": "@tmedxp/prettier-config"
}
Terminal window
npm install --save-dev @tmedxp/tsconfig
tsconfig.json
{
"extends": "@tmedxp/tsconfig/base.json",
"include": ["src/"]
}