Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
box-content-ui-kits
Advanced tools
The Box Content UI Kits are currently in beta and may contain bugs. Their interfaces may also update as needed. Please email box-ui-kit-feedback@box.com to report issues or provide feedback.
yarn add box-content-ui-kits
Please follow the documentation links below if you would like to use the UI kits as library includes. Examples below show how to import UI kits into your React based app.
We have designed the UI kits in an authentication-type agnostic way so whether you are using UI kits for users who have Box accounts (Managed Users) or non-Box accounts (App Users), UI Kits should just work out of the box. The UI Kits only expect a token to be passed in for authentication, and Box provides two different ways to generate tokens - OAuth and JWT. So depending on which type of app you are building, follow the linked authentication guides above on how to initiate auth and retrieve tokens.
The Box Content UI Kits require their corresponding CSS stylesheet to render properly. This will require setting up webpack's style-loader / css-loader plugins to properly process that CSS if you import it as shown in the examples below. Alternatively, you can just include the CSS file in your apps's HTML without importing it into javascript.
You can import the ContentExplorer
, ContentPicker
(FilePicker
/ FolderPicker
), ContentUploader
, ContentPreview
or ContentTree
. Likewise you can also import ContentPickerPopup
(FilePickerPopup
/ FolderPickerPopup
), ContentUploaderPopup
or ContentTreePopup
which are popup versions for the picker, uploader and content tree respectively. Examples:
import React from 'react';
import { render } from 'react-dom';
import { ContentExplorer } from 'box-content-ui-kits';
import messages from 'box-content-ui-kits/lib/i18n/en-US';
import 'box-content-ui-kits/dist/explorer.css';
const getLocalizedMessage = (id, replacements) =>
messages[id].replace(/{\s*(\w+)\s*}/g, (match, key) => replacements[key]);
render(
<ContentExplorer
token={token}
getLocalizedMessage={getLocalizedMessage}
/>,
document.querySelector('.container')
);
import React from 'react';
import { render } from 'react-dom';
import { FilePicker } from 'box-content-ui-kits';
import messages from 'box-content-ui-kits/lib/i18n/en-US';
import 'box-content-ui-kits/dist/picker.css';
const getLocalizedMessage = (id, replacements) =>
messages[id].replace(/{\s*(\w+)\s*}/g, (match, key) => replacements[key]);
render(
<FilePicker
token={token}
getLocalizedMessage={getLocalizedMessage}
/>,
document.querySelector('.container')
);
import React from 'react';
import { render } from 'react-dom';
import { FolderPicker } from 'box-content-ui-kits';
import messages from 'box-content-ui-kits/lib/i18n/en-US';
import 'box-content-ui-kits/dist/picker.css';
const getLocalizedMessage = (id, replacements) =>
messages[id].replace(/{\s*(\w+)\s*}/g, (match, key) => replacements[key]);
render(
<FolderPicker
token={token}
getLocalizedMessage={getLocalizedMessage}
/>,
document.querySelector('.container')
);
import React from 'react';
import { render } from 'react-dom';
import { ContentUploader } from 'box-content-ui-kits';
import messages from 'box-content-ui-kits/lib/i18n/en-US';
import 'box-content-ui-kits/dist/uploader.css';
const getLocalizedMessage = (id, replacements) =>
messages[id].replace(/{\s*(\w+)\s*}/g, (match, key) => replacements[key]);
render(
<ContentUploader
token={token}
getLocalizedMessage={getLocalizedMessage}
/>,
document.querySelector('.container')
);
import React from 'react';
import { render } from 'react-dom';
import { ContentTree } from 'box-content-ui-kits';
import messages from 'box-content-ui-kits/lib/i18n/en-US';
import 'box-content-ui-kits/dist/tree.css';
const getLocalizedMessage = (id, replacements) =>
messages[id].replace(/{\s*(\w+)\s*}/g, (match, key) => replacements[key]);
render(
<ContentTree
token={token}
getLocalizedMessage={getLocalizedMessage}
/>,
document.querySelector('.container')
);
Note: The Box Content Preview has a slightly different interface than the other UI kits. Instead of importing localizations like the examples above, it requires a locale (defaults to en-US) to be passed in. This will automatically pull in the appropiate preview bundle and dynamically load it. It will also dynamically load the required CSS file.
import React from 'react';
import { render } from 'react-dom';
import { ContentPreview } from 'box-content-ui-kits';
render(
<ContentPreview
id={id}
locale='en-US'
token={token}
/>,
document.querySelector('.container')
);
Need to contact us directly? Email oss@box.com and be sure to include the name of this project in the subject.
Copyright 2016-2017 Box, Inc. All Rights Reserved.
Licensed under the Box Software License Agreement v.20170516. You may not use this file except in compliance with the License. You may obtain a copy of the License at Box UI Kit Software License Agreement
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Box Content UI Kits
The npm package box-content-ui-kits receives a total of 60 weekly downloads. As such, box-content-ui-kits popularity was classified as not popular.
We found that box-content-ui-kits demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.