Covalent organic frameworks (COFs), based on melamine and dibromoalkanes [Br(CH2)(n)Br] with n = 2, 4, 6, and 8 for 1,2-dibromoethane, 1,4-dibromobutane, 1,6-bibromohexane and 1,8-dibromooctane as COF-1,2, COF-1,4, COF-1,6, COF-1,8, were synthesized in dimethyl sulfoxide at 150 A degrees C. The COFs had distinct color depending on the number of C atoms (n) in the dibromoalkanes e.g., light-yellow, intense yellow, brown and dark brown for COF-1,2, COF-1,4, COF-1,6, and COF-1,8, respectively. Furthermore, it was demonstrated that COF-1,2 and COF-1,4 COFs can be used as a template for in situ Co metal nanoparticle preparation by loading CoCl2 salt from ethanol solution into COFs and then treating with NaBH4 solution. Then the prepared catalyst systems of COF-1,2-Co and COF-1,4-Co were tested for H-2 generation from hydrolysis of NaBH4. The COF-1,2-Co composite materials showed better catalyst performance than COF-1,4-Co composite in the hydrolysis of NaBH4. The hydrogen generation rates (HGR) and turnover frequency values were calculated as 1589 and 594 ml H-2/(g of catalyst) x (min) HGR values, and 3.75 and 1.41 mol H-2/(mol catalyst min) for COF-1,2-Co and COF-1,4-Co composite materials, respectively. The room temperature conductivities were measured and the highest conductivity was measured as 2.26E-07 S cm(-1) for COF-1,2-(CoCl2). The COF also had fluorescent properties and their emission wavelengths reduced in the presence of Co nanoparticles depending on the n values of the dibromoalkanes.