• Getting Started
  • Components
  • Github
  • Go pro
energyGetting started
  • Introduction
dComponents
  • Button Components
  • Grid Components
  • Input Components
  • Layout Components
  • Toast Components
  • Widget Components
  • Alert
  • Badge
  • Breadcrumb
  • Callout
  • Card
  • Carousel
  • Charts
  • Collapse
  • CreateElement
  • DataTable
  • Dropdown
  • ElementCover
  • Embed
  • Fade
  • Form
  • Icon
  • Img
  • Jumbotron
  • Link
  • ListGroup
  • Media
  • Modal
  • Nav
  • Navbar
  • Pagination
  • Popover
  • Progress
  • Spinner
  • Switch
  • Tabs
  • Toggler
  • Tooltip

Link

React link component (a or NavLink).


Usage

Example

Normal external link.
Disabled link without action
Custom link.Normal external link
Disabled link without action
Custom link

Script


  return (
    <div>
      <CRow>
        <CCol>
          <CLink
            href="https://coreui.io"
            target="_blank"
          >
            Normal external link.
          </CLink>
          <br />
          <CLink disabled>
            Disabled link without action
          </CLink>
          <br />
          <CLink
            className="text-white bg-info px-2"
            href="https://coreui.io"
            target="_blank"
          >
            Custom link.
          </CLink>

          <CLink
            href="https://coreui.io"
            target="_blank"
          >
            Normal external link
          </CLink>
          <br />
          <CLink disabled>
            Disabled link without action
          </CLink>
          <br />
          <CLink
            className="text-white bg-info px-2"
            href="https://coreui.io"
            target="_blank"
          >
            Custom link
          </CLink>

        </CCol>
      </CRow>
    </div>
  )
  


# Features

  • Linking to external sources or router-links
  • If link is empty, component prevents scrolling up the page after clicking

To turn link into router-link just pass address in 'to' prop instead of 'href'. Then component will become router link extended by base 'CLink' props.

# Link API

NameRequiredTypeDefault Value
innerRef(object | Function | string)
ref to the main tag
activeboolean
set link to active
hrefstring
href HTML attribute of link
onClickFunction
on click callback
disabledboolean
disable link
className(string | any[])
user classes for the main HTML tag
to(object | string | Function)
link to the application page specified as router-link

  • Components
    • Usage
      • Features
      • API
CoreUI © 2020 creativeLabs.core-logo