npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

darth-portal-ui

v1.1.4

Published

darth portal

Readme

UI-Components

公司内部项目UI标准React组件库。

支持环境

  • 现代浏览器和 IE11 及以上。
  • 内部css使用的sass预处理语言
  • 国际化采用i18n

说明

  • 内部css使用的sass预处理语言
  • 国际化采用i18n, 需要在将内部的国际语言配置项目的国际话配置中 import{portal_cn, portal_en} from darth-portal-ui/language
  • 获取内部store import{stores} from darth-portal-ui import{stores as portalStores} from darth-portal-ui 在入口文件中
const App = () => {
const allStore = {...stores, ...portalStores}
    return (
        <Provider {...stores}>
            <StoresContext.Provider value={allStore}>
                <BrowserRouter>
                    <div>
                        {renderRoutes(routers)}
                    </div>
                </BrowserRouter>
            </StoresContext.Provider>
        </Provider>
    )
};

安装

npm install --save darth-portal-ui

示例

import React from 'react';
import {observer } from 'mobx-react';
import logo from '../../images/logo.jpeg'
import Portal from "../../components/portal";

const Home = (props) => {
    const homeRouter = [
        {
            to:'/',
            title:'首页',
            key: '/'
        },
        {
            to:'/home',
            title:'组织中心',
            key: 'org'
        },
    ]

    const onSearch = (e) => {
        console.log(e, 'search')
    }

    const data = []


    return <Portal
        logo={logo}
        routers={homeRouter}
        enterSearch={onSearch}
        AsideComponent={ 'side'}
        FooterComponent={'footer'}
        redirect={'/login'}
        {...props}
    >
        content
        <div>111</div>
    </Portal>
}

export default observer(Home)

| 成员 | 说明 | 类型 |默认值 | | ---- | ---- | ---- |---- | | logo | header左上角的logo | 图片类型 | - | | routers |头部导航菜单 |array[]| [] | | enterSearch |头部搜索方法 |()=> HTMLElement| ()=> window| | AsideComponent |左侧边栏 |string 或者 react.element| - | | FooterComponent |页脚 |string 或者 react.element| - | | redirect |重定向路由 |string | '/login' | | logoName |className |string | - |

import {PortalLogin} from 'darth-portal-ui'

<PortalLogin logoImg={logo}
        contentImg={contentImg}
        {...props}
        loginGoRouter={'/'}
    >
        {this.props.children}
    </PortalLogin>

| 成员 | 说明 | 类型 |默认值 | | ---- | ---- | ---- |---- | | logoImg | header左上角的logo | 图片类型 | - | | contentImg |内容区域左侧图片 |图片类型| - | | loginGoRouter |登录成功跳转的路由 |string| -| | logoName |className |string | - |