@fortawesome/free-solid-svg-icons APIs
- faTimes
- faSearch
- faPlus
- faBars
- faCheck
- faEnvelope
- fas
- faTrash
- faArrowLeft
- faEdit
- faChevronDown
- faCheckCircle
- faHeart
- faExternalLinkAlt
- faHome
- faSpinner
- faArrowRight
- faEye
- faSignOutAlt
- faUsers
- faTrashAlt
- faTimesCircle
- faMapMarkerAlt
- faUser
- faChevronRight
- faAngleRight
- faCopy
- faExclamationTriangle
- faDownload
- faCog
- faAngleDown
- faUpload
- faLink
- faShoppingCart
- faCogs
- faInfoCircle
- faQuestionCircle
- faMoon
- faStar
- faGlobe
- faUserPlus
- faAngleUp
- faArrowDown
- faPhone
- faPlay
- faPencilAlt
- faCode
- faCalendar
- faSyncAlt
- faArrowUp
- faAngleLeft
- faEllipsisV
- faEyeSlash
- faChevronLeft
- faFile
- faChevronUp
- faClock
- faSun
- faCalendarAlt
- faSync
- faPaperPlane
- faQuestion
- faDollarSign
- faSignInAlt
- faList
- faFilter
- faComment
- faLock
- faUserCircle
- faShoppingBag
- faBell
- faFileAlt
- faBullhorn
- faMinus
- faPaperclip
- faCaretDown
- faHandHoldingUsd
- faHandshake
- faThumbsUp
- faChartPie
- faCodeBranch
- faTh
- faFolder
- faLaptop
- faTag
- faBook
- faCircleNotch
- faWrench
- faHistory
- faBan
- faExclamationCircle
- faPen
- faPause
- faMinusCircle
- faAlignLeft
- faAngleDoubleLeft
- faAngleDoubleRight
- faCalendarDay
- faLaptopCode
- faFire
- faPalette
- faMailBulk
- faRedoAlt
- faSave
- faEraser
- faBriefcase
- faFolderOpen
- faCompass
- faLightbulb
- faBox
- faVideo
- faLocationArrow
- faChartBar
- faExchangeAlt
- faTable
- faTachometerAlt
- faImages
- faShare
- faShareAlt
- faPlusSquare
- faShareSquare
- faVolumeMute
- faVolumeUp
- faFolderPlus
- faImage
- faCalculator
- faDatabase
- faRandom
- faMapPin
- faMapMarker
- faTabletAlt
- faUserFriends
- faAward
- faCalendarCheck
- faCoffee
- faGreaterThan
- faArrowCircleRight
- faFlask
- faStarHalfAlt
- faCompressAlt
- faExpandAlt
- faSortUp
- faSortDown
- faEllipsisH
- faMobileAlt
- faCross
- faShoppingBasket
- faCommentDots
- faBuilding
- faSearchDollar
- faMoneyCheck
- faExclamation
- faCloudDownloadAlt
- faChartLine
- faBookmark
- faMap
- faInbox
- faUnlink
- faUndo
- faPlusCircle
- faPlug
- faTools
- faClipboard
- faThLarge
- faComments
- faRedo
- faAddressBook
- faArrowsAlt
- faMicrochip
- faCubes
- faIdBadge
- faChartArea
- faBolt
- faMedal
- faTrophy
- faUserEdit
- faChalkboardTeacher
- faGraduationCap
- faUserGraduate
- faPercent
- faHandPointer
- faUndoAlt
- faFillDrip
- faFileUpload
- faVirus
- faGlobeAmericas
- faCalendarWeek
- faCalendarTimes
- faPhoneAlt
- faFilePdf
- faClipboardList
- faEnvelopeSquare
- faLessThan
- faGripLinesVertical
- faStepBackward
- faStepForward
- faCamera
- faBellSlash
- faArrowCircleDown
- faHeadSideCough
- faIndustry
- faLongArrowAltRight
- faDrawPolygon
- faMicrophone
- faMicrophoneSlash
- faWindowMinimize
- faWindowMaximize
- faCircle
- faVideoSlash
- faFileDownload
- faCheckSquare
- faServer
- faEquals
- faCreditCard
- faCartPlus
- faSearchPlus
- faPlaneDeparture
- faLanguage
- faInfo
- faRss
- faSnowflake
- faFan
- faThumbsDown
- faStop
- faGamepad
- faArrowAltCircleLeft
- faArrowAltCircleRight
- faAtom
- faCaretSquareLeft
- faCaretSquareRight
- faUserSlash
- faMoneyBill
- faCloudMoon
- faCar
- faHandPaper
- faMoneyBillWaveAlt
- faBorderAll
- faHotel
- faHatCowboySide
- faDog
- faCat
- faShip
- faFrog
- faTrain
- faFaucet
- faArrowAltCircleUp
- faStream
- faArrowsAltV
- faExternalLinkSquareAlt
- faLockOpen
- faClipboardCheck
- faFileSignature
- faMagnet
- faPencilRuler
- faRulerCombined
- faMusic
- faCommentAlt
- faFilm
- faCut
- faChevronCircleDown
- faRssSquare
- faTree
- faPrint
- faStamp
- faEllipsis
- faRefresh
- faForward
- faAdjust
- faScroll
- faRobot
- faCaretRight
- faFileImport
- faSatelliteDish
- faSlidersH
- faHourglassHalf
- faAsterisk
- faBlog
- faSignal
- faRoad
- faSuperscript
- faTags
- faFlagUsa
- faGlobeEurope
- faDesktop
- faArrowCircleLeft
- faPoll
- faFileInvoice
- faMagic
- faAt
- faNetworkWired
- faBookReader
- faDonate
- faInfinity
- faUserNinja
OtherRelated APIs
- react#useState
- @fortawesome/react-fontawesome#FontAwesomeIcon
- @fortawesome/free-solid-svg-icons#faShareSquare
- @fortawesome/free-solid-svg-icons#faHome
- @fortawesome/free-solid-svg-icons#faStar
- @fortawesome/free-solid-svg-icons#faCaretSquareLeft
- @fortawesome/free-solid-svg-icons#faUserPlus
- @fortawesome/free-solid-svg-icons#faUserSlash
- @fortawesome/free-brands-svg-icons#faGoogleDrive
@fortawesome/free-solid-svg-icons#faCaretSquareRight JavaScript Examples
The following examples show how to use
@fortawesome/free-solid-svg-icons#faCaretSquareRight.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Sidebar.jsx From UniDrive with GNU General Public License v2.0 | 4 votes |
export default function Sidebar({
authorizeUser, filterFilesInAllAccounts, userList, removeAllAccounts,
starFilter,
}) {
const body = document.getElementsByTagName('body')[0];
const style = getComputedStyle(body);
const initialState = (style.getPropertyValue('--sidebar-width') === '225px');
const [expand, setExpand] = useState(initialState);
const selectedElementList = document.getElementsByClassName('selected');
const initilaSelected = (selectedElementList.length === 0) ? 'all-files' : selectedElementList[0].id;
const [selected, setSelected] = useState(initilaSelected);
const scrollToggle = (ref) => {
userList.forEach((user) => {
user.ref.current.style.display = 'none';
});
ref.current.style.display = 'block';
window.scrollTo(0, ref.current.offsetTop - 100);
};
const toggleExpand = () => {
const sidebarItem = document.getElementsByClassName('collapsible');
Array.from(sidebarItem).forEach((item) => {
if (expand) {
item.classList.add('collapse');
body.style.setProperty('--sidebar-width', '60px');
} else {
item.classList.remove('collapse');
body.style.setProperty('--sidebar-width', '225px');
}
});
setExpand(!expand);
};
const handleClick = (target) => {
setSelected(target);
let query = 'trashed = false';
if (target === 'my-drive') {
query += ' and "me" in owners';
} else if (target === 'shared') {
query += ' and not "me" in owners';
} else if (target === 'starred') {
starFilter();
return;
}
filterFilesInAllAccounts(query);
};
const sidebarClassName = (expand) ? 'collapsible' : 'collapsible collapse';
return (
<div className={(expand) ? 'sidebar' : 'sidebar collapse'}>
<div>
<button type="button" className="sidebar-add-button" id="signin-btn" onClick={() => authorizeUser()}>
<FontAwesomeIcon icon={faUserPlus} size="lg" title="Add an Account" />
{expand ? ' Add Account' : ''}
</button>
<button type="button" className="sidebar-remove-button" id="remove-btn" onClick={() => removeAllAccounts()}>
<FontAwesomeIcon icon={faUserSlash} size="lg" title="Remove All Accounts" />
{expand ? ' Remove All Accounts' : ''}
</button>
<button type="button" className={`sidebar-item ${sidebarClassName} ${(selected === 'all-files') ? 'selected' : ''}`} id="all-files" onClick={() => handleClick('all-files')}>
<FontAwesomeIcon className="sidebar-icon" icon={faHome} size="lg" title="All Files" />
{expand ? ' All Files' : ''}
</button>
<button type="button" className={`sidebar-item ${sidebarClassName} ${(selected === 'my-drive') ? 'selected' : ''}`} id="my-drive" onClick={() => handleClick('my-drive')}>
<FontAwesomeIcon className="sidebar-icon" icon={faGoogleDrive} size="lg" title="My Drive Files" />
{expand ? ' My Drive Files' : ''}
</button>
<button type="button" className={`sidebar-item ${sidebarClassName} ${(selected === 'shared') ? 'selected' : ''}`} id="shared" onClick={() => handleClick('shared')}>
<FontAwesomeIcon className="sidebar-icon" icon={faShareSquare} size="lg" title="Shared" />
{expand ? ' Shared' : ''}
</button>
<button type="button" className={`sidebar-item ${sidebarClassName} ${(selected === 'starred') ? 'selected' : ''}`} id="starred" onClick={() => handleClick('starred')}>
<FontAwesomeIcon className="sidebar-icon" icon={faStar} size="lg" title="Starred" />
{expand ? ' Starred' : ''}
</button>
<div className="sidebar-user-container">
{ userList.map((user) => {
const { name, picture } = parseIDToken(user.idToken);
const { ref } = user;
return (
<button type="button" className={`sidebar-user ${sidebarClassName}`} key={user.id} onClick={() => scrollToggle(ref)}>
<img className="sidebar-picture" src={picture} alt="Account profile" />
{expand ? ` ${name}` : ''}
</button>
);
})}
</div>
</div>
<div className="collapse-container collapsible">
<button type="button" className="collapse-button" onClick={() => toggleExpand()}>
<FontAwesomeIcon icon={expand ? faCaretSquareLeft : faCaretSquareRight} size="lg" title={expand ? 'Collapse' : 'Expand'} />
</button>
</div>
</div>
);
}