North Pittsburgh Meatpackers

    bpk-component-code

    3.1.8 • Public • Published

    bpk-component-code

    Backpack code component.

    Installation

    npm install bpk-component-code --save-dev

    Usage

    import React from 'react';
    import { BpkCode, BpkCodeBlock } from 'bpk-component-code';
    import BpkText from 'bpk-component-text';
    
    const codeBlock = `import React from 'react';
    import ReactDOM from 'react-dom';
    
    ReactDOM.render(<App />, ...);`;
    
    export default () => (
      <div>
        <BpkText tagName='p'>
          We recommend using React from npm with a bundler like webpack. You can use
          the <BpkCode>react</BpkCode> and <BpkCode>react-dom</BpkCode> packages. After installing it
          using <BpkCode>npm install --save react react-dom</BpkCode>, you can use:
        </BpkText>
        <BpkCodeBlock>{codeBlock}</BpkCodeBlock>
      </div>
    );

    Props

    For BpkCode & BpkCodeBlock:

    Property PropType Required Default Value
    children Node true -
    alternate bool false false
    className string false null

    Keywords

    none

    Install

    npm i bpk-component-code

    DownloadsWeekly Downloads

    2,096

    Version

    3.1.8

    License

    Apache-2.0

    Unpacked Size

    26.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • frugoman
    • zgeor
    • anambl
    • marianeumayer-skyscanner
    • ojcurt
    • mattface